You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await",
126
-
ty_cause.scope_span.or(Some(span)),
127
-
"these are all the await points this lock is held through",
125
+
"this `MutexGuard` is held across an `await` point",
126
+
|diag| {
127
+
diag.help(
128
+
"consider using an async-aware `Mutex` type or ensuring the \
129
+
`MutexGuard` is dropped before calling await",
130
+
);
131
+
diag.span_note(
132
+
ty_cause.scope_span.unwrap_or(span),
133
+
"these are all the `await` points this lock is held through",
134
+
);
135
+
},
128
136
);
129
137
}
130
138
ifis_refcell_ref(cx, adt.did){
131
-
span_lint_and_note(
139
+
span_lint_and_then(
132
140
cx,
133
141
AWAIT_HOLDING_REFCELL_REF,
134
142
ty_cause.span,
135
-
"this RefCell Ref is held across an 'await' point. Consider ensuring the Ref is dropped before calling await",
136
-
ty_cause.scope_span.or(Some(span)),
137
-
"these are all the await points this ref is held through",
143
+
"this `RefCell` reference is held across an `await` point",
144
+
|diag| {
145
+
diag.help("ensure the reference is dropped before calling `await`");
146
+
diag.span_note(
147
+
ty_cause.scope_span.unwrap_or(span),
148
+
"these are all the `await` points this reference is held through",
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await
1
+
error: this `MutexGuard` is held across an `await` point
2
2
--> $DIR/await_holding_lock.rs:6:9
3
3
|
4
4
LL | let guard = x.lock().unwrap();
5
5
| ^^^^^
6
6
|
7
7
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
8
-
note: these are all the await points this lock is held through
8
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
9
+
note: these are all the `await` points this lock is held through
9
10
--> $DIR/await_holding_lock.rs:6:5
10
11
|
11
12
LL | / let guard = x.lock().unwrap();
12
13
LL | | baz().await
13
14
LL | | }
14
15
| |_^
15
16
16
-
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await
17
-
--> $DIR/await_holding_lock.rs:27:9
17
+
error: this `MutexGuard` is held across an `await` point
18
+
--> $DIR/await_holding_lock.rs:21:9
19
+
|
20
+
LL | let guard = x.read().unwrap();
21
+
| ^^^^^
22
+
|
23
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
24
+
note: these are all the `await` points this lock is held through
25
+
--> $DIR/await_holding_lock.rs:21:5
26
+
|
27
+
LL | / let guard = x.read().unwrap();
28
+
LL | | baz().await
29
+
LL | | }
30
+
| |_^
31
+
32
+
error: this `MutexGuard` is held across an `await` point
33
+
--> $DIR/await_holding_lock.rs:26:9
34
+
|
35
+
LL | let mut guard = x.write().unwrap();
36
+
| ^^^^^^^^^
37
+
|
38
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
39
+
note: these are all the `await` points this lock is held through
40
+
--> $DIR/await_holding_lock.rs:26:5
41
+
|
42
+
LL | / let mut guard = x.write().unwrap();
43
+
LL | | baz().await
44
+
LL | | }
45
+
| |_^
46
+
47
+
error: this `MutexGuard` is held across an `await` point
48
+
--> $DIR/await_holding_lock.rs:51:9
18
49
|
19
50
LL | let guard = x.lock().unwrap();
20
51
| ^^^^^
21
52
|
22
-
note: these are all the await points this lock is held through
23
-
--> $DIR/await_holding_lock.rs:27:5
53
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
54
+
note: these are all the `await` points this lock is held through
55
+
--> $DIR/await_holding_lock.rs:51:5
24
56
|
25
57
LL | / let guard = x.lock().unwrap();
26
58
LL | |
@@ -31,33 +63,35 @@ LL | | first + second + third
31
63
LL | | }
32
64
| |_^
33
65
34
-
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await
35
-
--> $DIR/await_holding_lock.rs:40:13
66
+
error: this `MutexGuard` is held across an `await` point
67
+
--> $DIR/await_holding_lock.rs:64:13
36
68
|
37
69
LL | let guard = x.lock().unwrap();
38
70
| ^^^^^
39
71
|
40
-
note: these are all the await points this lock is held through
41
-
--> $DIR/await_holding_lock.rs:40:9
72
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
73
+
note: these are all the `await` points this lock is held through
74
+
--> $DIR/await_holding_lock.rs:64:9
42
75
|
43
76
LL | / let guard = x.lock().unwrap();
44
77
LL | | baz().await
45
78
LL | | };
46
79
| |_____^
47
80
48
-
error: this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await
49
-
--> $DIR/await_holding_lock.rs:52:13
81
+
error: this `MutexGuard` is held across an `await` point
82
+
--> $DIR/await_holding_lock.rs:76:13
50
83
|
51
84
LL | let guard = x.lock().unwrap();
52
85
| ^^^^^
53
86
|
54
-
note: these are all the await points this lock is held through
55
-
--> $DIR/await_holding_lock.rs:52:9
87
+
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
88
+
note: these are all the `await` points this lock is held through
0 commit comments