11error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
2- --> tests/ui/if_let_mutex.rs:11 :5
2+ --> tests/ui/if_let_mutex.rs:16 :5
33 |
44LL | if let Err(locked) = m.lock() {
55 | ^ - this Mutex will remain locked for the entire `if let`-block...
66 | _____|
77 | |
88LL | |
9+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
910LL | | do_stuff(locked);
1011LL | | } else {
1112LL | | let lock = m.lock().unwrap();
@@ -19,13 +20,14 @@ LL | | };
1920 = help: to override `-D warnings` add `#[allow(clippy::if_let_mutex)]`
2021
2122error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
22- --> tests/ui/if_let_mutex.rs:24 :5
23+ --> tests/ui/if_let_mutex.rs:30 :5
2324 |
2425LL | if let Some(locked) = m.lock().unwrap().deref() {
2526 | ^ - this Mutex will remain locked for the entire `if let`-block...
2627 | _____|
2728 | |
2829LL | |
30+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
2931LL | | do_stuff(locked);
3032LL | | } else {
3133LL | | let lock = m.lock().unwrap();
@@ -37,13 +39,14 @@ LL | | };
3739 = help: move the lock call outside of the `if let ...` expression
3840
3941error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
40- --> tests/ui/if_let_mutex.rs:46 :5
42+ --> tests/ui/if_let_mutex.rs:53 :5
4143 |
4244LL | if let Ok(i) = mutex.lock() {
4345 | ^ ----- this Mutex will remain locked for the entire `if let`-block...
4446 | _____|
4547 | |
4648LL | |
49+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
4750LL | | do_stuff(i);
4851LL | | } else {
4952LL | | let _x = mutex.lock();
@@ -54,7 +57,7 @@ LL | | };
5457 = help: move the lock call outside of the `if let ...` expression
5558
5659error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
57- --> tests/ui/if_let_mutex.rs:55 :5
60+ --> tests/ui/if_let_mutex.rs:63 :5
5861 |
5962LL | if let Ok(_) = m1.lock() {
6063 | ^ -- this Mutex will remain locked for the entire `if let`-block...
0 commit comments