diff options
| author | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:40:02 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:51:42 +0100 |
| commit | 02e812af4d936a0984802bb76bb3e423e2fb94a5 (patch) | |
| tree | 196fe8bde7074c1a5fa2b0af4a74892c51c8188c /tests/ui/missing_spin_loop.fixed | |
| parent | 17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff) | |
| parent | 15180d4eb9dcff9441a8c3ff3382804123c5b0a1 (diff) | |
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/missing_spin_loop.fixed')
| -rw-r--r-- | tests/ui/missing_spin_loop.fixed | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/missing_spin_loop.fixed b/tests/ui/missing_spin_loop.fixed index b6520d478be..03fbf8ccc8a 100644 --- a/tests/ui/missing_spin_loop.fixed +++ b/tests/ui/missing_spin_loop.fixed @@ -8,16 +8,22 @@ fn main() { let b = AtomicBool::new(true); // Those should lint while b.load(Ordering::Acquire) { std::hint::spin_loop() } + //~^ missing_spin_loop while !b.load(Ordering::SeqCst) { std::hint::spin_loop() } + //~^ missing_spin_loop while b.load(Ordering::Acquire) == false { std::hint::spin_loop() } + //~^ missing_spin_loop while { true == b.load(Ordering::Acquire) } { std::hint::spin_loop() } + //~^ missing_spin_loop while b.compare_exchange(true, false, Ordering::Acquire, Ordering::Relaxed) != Ok(true) { std::hint::spin_loop() } + //~^ missing_spin_loop while Ok(false) != b.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { std::hint::spin_loop() } + //~^ missing_spin_loop // This is OK, as the body is not empty while b.load(Ordering::Acquire) { |
