Closed
Description
Location
core::sync::atomic::AtomicUsize::from_mut
core::sync::atomic::AtomicIsize::from_mut
Summary
The documentation for AtomicUsize::from_mut
claims that it's only available when usize
has alignment 8, but in reality it's available when usize
has alignment equal to its size (AFAICT), which is different on non-64-bit platforms. For example, this code compiles on 32-bit Linux:
#![feature(atomic_from_mut)]
use std::sync::atomic::AtomicUsize;
pub fn main(){
let mut x: usize = 0;
assert_eq!(std::mem::size_of_val(&x), 4);
let _y: &mut AtomicUsize = AtomicUsize::from_mut(&mut x);
}
Metadata
Metadata
Assignees
Labels
Area: Documentation for any part of the project, including the compiler, standard library, and toolsCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Help is requested to fix this issue.Relevant to the library team, which will review and decide on the PR/issue.