]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/if_let_mutex.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / if_let_mutex.stderr
CommitLineData
f20569fa
XL
1error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
2 --> $DIR/if_let_mutex.rs:10:5
3 |
f2b60f7d
FG
4LL | if let Err(locked) = m.lock() {
5 | ^ - this Mutex will remain locked for the entire `if let`-block...
6 | _____|
7 | |
f20569fa
XL
8LL | | do_stuff(locked);
9LL | | } else {
10LL | | let lock = m.lock().unwrap();
f2b60f7d 11 | | - ... and is tried to lock again here, which will always deadlock.
f20569fa
XL
12LL | | do_stuff(lock);
13LL | | };
14 | |_____^
15 |
16 = note: `-D clippy::if-let-mutex` implied by `-D warnings`
17 = help: move the lock call outside of the `if let ...` expression
18
19error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
20 --> $DIR/if_let_mutex.rs:22:5
21 |
f2b60f7d
FG
22LL | if let Some(locked) = m.lock().unwrap().deref() {
23 | ^ - this Mutex will remain locked for the entire `if let`-block...
24 | _____|
25 | |
f20569fa
XL
26LL | | do_stuff(locked);
27LL | | } else {
28LL | | let lock = m.lock().unwrap();
f2b60f7d 29 | | - ... and is tried to lock again here, which will always deadlock.
f20569fa
XL
30LL | | do_stuff(lock);
31LL | | };
32 | |_____^
33 |
34 = help: move the lock call outside of the `if let ...` expression
35
f2b60f7d
FG
36error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
37 --> $DIR/if_let_mutex.rs:43:5
38 |
39LL | if let Ok(i) = mutex.lock() {
40 | ^ ----- this Mutex will remain locked for the entire `if let`-block...
41 | _____|
42 | |
43LL | | do_stuff(i);
44LL | | } else {
45LL | | let _x = mutex.lock();
46 | | ----- ... and is tried to lock again here, which will always deadlock.
47LL | | };
48 | |_____^
49 |
50 = help: move the lock call outside of the `if let ...` expression
51
52error: aborting due to 3 previous errors
f20569fa 53