Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for ptr::{read,write}_volatile #31756
Comments
alexcrichton
added
B-RFC-approved
T-libs
labels
Feb 18, 2016
This comment has been minimized.
This comment has been minimized.
|
cc @Amanieu, would you be interested in implementing? |
This comment has been minimized.
This comment has been minimized.
|
I'll give it a go when I find some free time, hopefully this weekend. |
bors
added a commit
that referenced
this issue
Feb 21, 2016
cmr
added
the
B-unstable
label
Mar 6, 2016
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
removed
the
B-RFC-approved
label
Mar 9, 2016
sfackler
added
the
I-nominated
label
Mar 9, 2016
This comment has been minimized.
This comment has been minimized.
|
The libs team is comfortable with these APIs as-is, but we're pretty worried about stabilizing with the LLVM assert being a known downside. If the assert hasn't been fixed by the time the 1.9 beta release rolls around we'll likely just punt on stabilization of these APIs. |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Mar 11, 2016
This comment has been minimized.
This comment has been minimized.
|
How will volatile reads/writes not supported by the platform be reported back to the user? |
This comment has been minimized.
This comment has been minimized.
|
Should |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The assert should be fixed by #32233 |
This comment has been minimized.
This comment has been minimized.
|
Hm.. it seems LLVM will implicitly split volatile operations that aren't supported. I'm not sure that is desirable semantics. |
This comment has been minimized.
This comment has been minimized.
|
C does the same thing so I think it's fine. |
This comment has been minimized.
This comment has been minimized.
|
cc @rust-lang/compiler @rust-lang/lang -- the libs team will be meeting soon to reach a stabilization decision. This API cuts across your concerns as well, so please have a look! |
This comment has been minimized.
This comment has been minimized.
|
Since we don't really have a memory model/Rust abstract machine, we don't have a strong model for what volatile means (the C definition is essentially "execute exactly the operations the C abstract machine would execute"). I imagine this isn't particularly problematic in practice, but it seems like something to keep in mind. Also, we may want to make sure the documentation doesn't tie the behaviour of these functions to LLVM's definition of volatile? (It currently refers to the LLVM docs, a reference we may want to either remove or explicitly state is non-binding.) |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage yesterday and the decision was to stabilize. We discussed what the documentation would look like and we concluded that we should point to C11 instead of LLVM and also add a note saying that the memory model for Rust isn't formally defined so the precise semantics are subject to change, but it's likely to be "suitable as an equivalent to volatile in C" or something like that. |
alexcrichton commentedFeb 18, 2016
Tracking issue for rust-lang/rfcs#1467