@comex and me are having an interesting discussion at https://www.reddit.com/r/rust/comments/chmnuo/any_unsafe_way_to_get_read_access_to/euyuea4/
I feel we should put the result of this somewhere into the UCG -- a new issue, at least
I added a note at https://github.com/rust-lang/unsafe-code-guidelines/issues/33#issuecomment-515969457 because I didn't feel like opening a third issue around volatile would help (we have one for MMIO and one for interaction with concurrency, which I think covers the two things volatile is used for, and they are already mixed up, of course).
The problem is, these threads are both very long, nobody is going to read them entirely. But it's also not like they have reached a firm conclusion or even agreed on a clear core with some open questions. it's just all-around messy and in flux. I am not sure what to do about that.
@RalfJ could we use that for
black_box ? E.g. saying that
black_box is an externally observable event, and then have each backend say what it does in the actual hardware (e.g. nothing)
@gnzlbg I wondered the same thing, but didn't ponder it yet
or maybe worded differently, if we can't say that for
black_box, why can we say that for volatile ?
indeed that would be the question
I added another post trying to explain what I mean with the first post by means of an example... but this is much harder to explain whan I initially realized^^
really this is material for several blog posts that I don't have time to write right now, so all I can offer is this braindump
Now I just have to remember to link to https://github.com/rust-lang/unsafe-code-guidelines/issues/33#issuecomment-515969457 any time volatile comes up, because being burried somewhere in that long thread, nobody is going to be able to find this^^
My opinion, but I think it's fine to edit the initial comment with a table of contents to important comments / other PRs
yeah I considered that as well. but I am also very biased about what the important comments are. ;)