Closed
Description
@jonas-schievink pointed out that our atomic::Ordering
docs say
Rust's memory orderings are the same as LLVM's.
That's not really correct though... at least according to the Nomicon, we use the C11 memory model, which is different from LLVM's. The kinds of ordering that exist are the same (at least insofar as Rust exposes them), but the details of the rules around data races are different.
Code that mixes atomic and non-atomic accesses on the same location can behave differently under both models (concretely, some programs that are UB under C11 are no longer UB under LLVM). So if people interpret "same as LLVM's" too strongly, they might be mislead.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Documentation for any part of the project, including the compiler, standard library, and toolsCategory: This is a bug.Relevant to the language team, which will review and decide on the PR/issue.