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.",
82
+
ty_cause.scope_span.unwrap_or(span),
83
+
"these are all the await points this lock is held through",
84
+
);
75
85
}
76
86
}
77
87
}
78
88
}
79
89
80
-
fnis_async_fn(fn_kind:FnKind<'_>) -> bool{
81
-
fn_kind.header().map_or(false, |h| match h.asyncness{
Copy file name to clipboardExpand all lines: tests/ui/await_holding_lock.stderr
+31-3
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
error: this MutexGuard is held across an 'await' point
1
+
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.
2
2
--> $DIR/await_holding_lock.rs:7:9
3
3
|
4
4
LL | let guard = x.lock().unwrap();
@@ -13,7 +13,7 @@ LL | | baz().await
13
13
LL | | }
14
14
| |_^
15
15
16
-
error: this MutexGuard is held across an 'await' point
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
17
--> $DIR/await_holding_lock.rs:28:9
18
18
|
19
19
LL | let guard = x.lock().unwrap();
@@ -31,5 +31,33 @@ LL | | first + second + third
31
31
LL | | }
32
32
| |_^
33
33
34
-
error: aborting due to 2 previous errors
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:41:13
36
+
|
37
+
LL | let guard = x.lock().unwrap();
38
+
| ^^^^^
39
+
|
40
+
note: these are all the await points this lock is held through
41
+
--> $DIR/await_holding_lock.rs:41:9
42
+
|
43
+
LL | / let guard = x.lock().unwrap();
44
+
LL | | baz().await
45
+
LL | | };
46
+
| |_____^
47
+
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
50
+
|
51
+
LL | let guard = x.lock().unwrap();
52
+
| ^^^^^
53
+
|
54
+
note: these are all the await points this lock is held through
0 commit comments