-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
Location (URL)
https://doc.rust-lang.org/std/sync/atomic/fn.compiler_fence.html
Summary
Halfway through the page it says ‘Panics if order is Relaxed’, but since compiler_fence is, as the name suggests, evaluated at compile time, it seemed strange to me.
In fact, I quickly checked with the line:
compiler_fence(Ordering::Relaxed);
and got a compilation error:
error: memory fences cannot have Relaxed ordering
--> src\main.rs:34:20
|
34 | compiler_fence(Ordering::Relaxed);
| ^^^^^^^^^^^^^^^^^
|
= help: consider using ordering modes Acquire, Release, AcqRel or SeqCst
= note: #[deny(invalid_atomic_ordering)] on by default
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.