]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-invalid-atomic-ordering-false-positive.rs
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / lint-invalid-atomic-ordering-false-positive.rs
1 // only-x86_64
2 // check-pass
3 use std::sync::atomic::{AtomicUsize, Ordering};
4
5 trait Foo {
6     fn store(self, ordering: Ordering);
7 }
8
9 impl Foo for AtomicUsize {
10     fn store(self, _ordering: Ordering) {
11         AtomicUsize::store(&self, 4, Ordering::SeqCst);
12     }
13 }
14
15 fn main() {
16     let x = AtomicUsize::new(3);
17     x.store(Ordering::Acquire);
18 }