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 upStabilize volatile read and write #1467
Conversation
nrc
added
the
T-libs
label
Jan 18, 2016
This comment has been minimized.
This comment has been minimized.
|
I think this RFC proposes to do an obviously right change. There’s no compatibility hazard I can think of and the functions are very useful in certain cases. |
This comment has been minimized.
This comment has been minimized.
|
I'd be happy to see these made stable, but are there any environments where these functions can be used without requiring other unstable things? Said another way, would stabilizing these functions make it so that some project can switch from nightly to stable? I know that doesn't need to be a requirement, and we have to start somewhere. |
This comment has been minimized.
This comment has been minimized.
|
Seems like a good idea to me. |
This comment has been minimized.
This comment has been minimized.
|
As a bit of a bikeshed I might prefer to rename these to I think the biggest question in terms of stabilization is what does volatile mean, and I agree with this RFC that it's well defined in C and other languages, so I would be fine having documentation redirecting to those relevant documents as well. I would perhaps feel best if we could hash out in this RFC exactly what semantics we'd point to (e.g. what documentation we'd point to) just to be extra sure it's ok, but that's not necessarily required in my opinion. In the long run I think we'll eventually want a wrapper like |
alexcrichton
self-assigned this
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
|
I renamed the functions to |
This comment has been minimized.
This comment has been minimized.
|
My own personal opinion is that this is good to go! |
alexcrichton
added
the
final-comment-period
label
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Feb 13, 2016
|
Please do not cite the LLVM documentation as the reference for the semantics. LLVM's documentation doesn't describe standard C semantics, but rather some semantics that are stronger, AFAICT, than what ISO C requires. If Rust wants to be different from ISO C11 then it would be better for Rust to specify what semantics it wants to have, and then verify whether LLVM implements (at least) the wanted semantics. The way this RFC looks now, it will be basically impossible to implement Rust without using LLVM, without reverse engineering LLVM. |
This comment has been minimized.
This comment has been minimized.
|
@briansmith note that this won't be the first Rust feature that is currently defined in terms of LLVM, nor do RFCs always have be complete specifications (i.e. we may want to learn more about how people want to use a feature before nailing down its semantics completely). Of course, having existing un(der)specified features doesn't automatically imply that we should add more. That said, I would expect documentation to not link to LLVM, but rather give some vague description about approximately what the semantics are (e.g. "volatile reads/writes are never elided nor reordered with other volatile reads/writes"), at least until Rust actually has a spec. |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this RFC during triage yesterday and the conclusion was to merge, so I will do so! Thanks again for the RFC @Amanieu! |
Amanieu commentedJan 18, 2016
This stabilizes the
volatile_loadandvolatile_storeintrinsics asptr::read_volatileandptr::write_volatile.Rendered