mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
19 lines
348 B
Rust
19 lines
348 B
Rust
//@ only-x86_64
|
|
//@ check-pass
|
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
trait Foo {
|
|
fn store(self, ordering: Ordering);
|
|
}
|
|
|
|
impl Foo for AtomicUsize {
|
|
fn store(self, _ordering: Ordering) {
|
|
AtomicUsize::store(&self, 4, Ordering::SeqCst);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let x = AtomicUsize::new(3);
|
|
x.store(Ordering::Acquire);
|
|
}
|