diff --git a/tests/ui/if_let_mutex.edition2021.stderr b/tests/ui/if_let_mutex.edition2021.stderr index 984d6adbb2a4e..58afd03c8c24f 100644 --- a/tests/ui/if_let_mutex.edition2021.stderr +++ b/tests/ui/if_let_mutex.edition2021.stderr @@ -1,5 +1,5 @@ error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock - --> tests/ui/if_let_mutex.rs:16:5 + --> tests/ui/if_let_mutex.rs:17:5 | LL | if let Err(locked) = m.lock() { | ^ - this Mutex will remain locked for the entire `if let`-block... @@ -19,7 +19,7 @@ LL | | }; = help: to override `-D warnings` add `#[allow(clippy::if_let_mutex)]` error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock - --> tests/ui/if_let_mutex.rs:29:5 + --> tests/ui/if_let_mutex.rs:30:5 | LL | if let Some(locked) = m.lock().unwrap().deref() { | ^ - this Mutex will remain locked for the entire `if let`-block... @@ -37,7 +37,7 @@ LL | | }; = help: move the lock call outside of the `if let ...` expression error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock - --> tests/ui/if_let_mutex.rs:51:5 + --> tests/ui/if_let_mutex.rs:52:5 | LL | if let Ok(i) = mutex.lock() { | ^ ----- this Mutex will remain locked for the entire `if let`-block... @@ -54,7 +54,7 @@ LL | | }; = help: move the lock call outside of the `if let ...` expression error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock - --> tests/ui/if_let_mutex.rs:60:5 + --> tests/ui/if_let_mutex.rs:61:5 | LL | if let Ok(_) = m1.lock() { | ^ -- this Mutex will remain locked for the entire `if let`-block... diff --git a/tests/ui/if_let_mutex.rs b/tests/ui/if_let_mutex.rs index ddf178b630486..72058ea33ee70 100644 --- a/tests/ui/if_let_mutex.rs +++ b/tests/ui/if_let_mutex.rs @@ -3,6 +3,7 @@ //@revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 +//@[edition2024] check-pass #![warn(clippy::if_let_mutex)] #![allow(clippy::redundant_pattern_matching)] @@ -62,10 +63,7 @@ fn multiple_mutexes(m1: &Mutex<()>, m2: &Mutex<()>) { } else { m1.lock(); } - //~^ if_let_mutex - //~^ if_let_mutex - //~^ if_let_mutex - //~^ if_let_mutex + //~[edition2021]^^^^^ if_let_mutex } fn main() {}