1 error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
2 --> $DIR/if_let_mutex.rs:10:5
4 LL | if let Err(locked) = m.lock() {
5 | ^ - this Mutex will remain locked for the entire `if let`-block...
8 LL | | do_stuff(locked);
10 LL | | let lock = m.lock().unwrap();
11 | | - ... and is tried to lock again here, which will always deadlock.
12 LL | | do_stuff(lock);
16 = note: `-D clippy::if-let-mutex` implied by `-D warnings`
17 = help: move the lock call outside of the `if let ...` expression
19 error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
20 --> $DIR/if_let_mutex.rs:22:5
22 LL | if let Some(locked) = m.lock().unwrap().deref() {
23 | ^ - this Mutex will remain locked for the entire `if let`-block...
26 LL | | do_stuff(locked);
28 LL | | let lock = m.lock().unwrap();
29 | | - ... and is tried to lock again here, which will always deadlock.
30 LL | | do_stuff(lock);
34 = help: move the lock call outside of the `if let ...` expression
36 error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
37 --> $DIR/if_let_mutex.rs:43:5
39 LL | if let Ok(i) = mutex.lock() {
40 | ^ ----- this Mutex will remain locked for the entire `if let`-block...
45 LL | | let _x = mutex.lock();
46 | | ----- ... and is tried to lock again here, which will always deadlock.
50 = help: move the lock call outside of the `if let ...` expression
52 error: aborting due to 3 previous errors