1
1
error: 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
3
3
|
4
4
LL | if let Err(locked) = m.lock() {
5
5
| ^ - this Mutex will remain locked for the entire `if let`-block...
6
6
| _____|
7
7
| |
8
8
LL | |
9
+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
9
10
LL | | do_stuff(locked);
10
11
LL | | } else {
11
12
LL | | let lock = m.lock().unwrap();
@@ -19,13 +20,14 @@ LL | | };
19
20
= help: to override `-D warnings` add `#[allow(clippy::if_let_mutex)]`
20
21
21
22
error: 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
23
24
|
24
25
LL | if let Some(locked) = m.lock().unwrap().deref() {
25
26
| ^ - this Mutex will remain locked for the entire `if let`-block...
26
27
| _____|
27
28
| |
28
29
LL | |
30
+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
29
31
LL | | do_stuff(locked);
30
32
LL | | } else {
31
33
LL | | let lock = m.lock().unwrap();
@@ -37,13 +39,14 @@ LL | | };
37
39
= help: move the lock call outside of the `if let ...` expression
38
40
39
41
error: 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
41
43
|
42
44
LL | if let Ok(i) = mutex.lock() {
43
45
| ^ ----- this Mutex will remain locked for the entire `if let`-block...
44
46
| _____|
45
47
| |
46
48
LL | |
49
+ LL | | // ERROR: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a d
47
50
LL | | do_stuff(i);
48
51
LL | | } else {
49
52
LL | | let _x = mutex.lock();
@@ -54,7 +57,7 @@ LL | | };
54
57
= help: move the lock call outside of the `if let ...` expression
55
58
56
59
error: 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
58
61
|
59
62
LL | if let Ok(_) = m1.lock() {
60
63
| ^ -- this Mutex will remain locked for the entire `if let`-block...
0 commit comments