]> git.lizzy.rs Git - rust.git/blob - tests/ui/if_let_mutex.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / if_let_mutex.stderr
1 error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
2   --> $DIR/if_let_mutex.rs:10:5
3    |
4 LL | /     if let Err(locked) = m.lock() {
5 LL | |         do_stuff(locked);
6 LL | |     } else {
7 LL | |         let lock = m.lock().unwrap();
8 LL | |         do_stuff(lock);
9 LL | |     };
10    | |_____^
11    |
12    = note: `-D clippy::if-let-mutex` implied by `-D warnings`
13    = help: move the lock call outside of the `if let ...` expression
14
15 error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
16   --> $DIR/if_let_mutex.rs:22:5
17    |
18 LL | /     if let Some(locked) = m.lock().unwrap().deref() {
19 LL | |         do_stuff(locked);
20 LL | |     } else {
21 LL | |         let lock = m.lock().unwrap();
22 LL | |         do_stuff(lock);
23 LL | |     };
24    | |_____^
25    |
26    = help: move the lock call outside of the `if let ...` expression
27
28 error: aborting due to 2 previous errors
29