File tree 2 files changed +4
-5
lines changed
src/test/ui/lint/must_not_suspend
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
// edition:2018
2
- #![ feature( must_not_suspend) ]
3
2
#![ deny( must_not_suspend) ]
4
3
5
4
async fn other ( ) { }
Original file line number Diff line number Diff line change 1
1
error: `MutexGuard` held across a suspend point, but should not be
2
- --> $DIR/mutex.rs:8 :9
2
+ --> $DIR/mutex.rs:7 :9
3
3
|
4
4
LL | let _guard = m.lock().unwrap();
5
5
| ^^^^^^
6
6
LL | other().await;
7
7
| ------------- the value is held across this suspend point
8
8
|
9
9
note: the lint level is defined here
10
- --> $DIR/mutex.rs:3 :9
10
+ --> $DIR/mutex.rs:2 :9
11
11
|
12
12
LL | #![deny(must_not_suspend)]
13
13
| ^^^^^^^^^^^^^^^^
14
14
note: Holding a MutexGuard across suspend points can cause deadlocks, delays, and cause Future's to not implement `Send`
15
- --> $DIR/mutex.rs:8 :9
15
+ --> $DIR/mutex.rs:7 :9
16
16
|
17
17
LL | let _guard = m.lock().unwrap();
18
18
| ^^^^^^
19
19
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
20
- --> $DIR/mutex.rs:8 :9
20
+ --> $DIR/mutex.rs:7 :9
21
21
|
22
22
LL | let _guard = m.lock().unwrap();
23
23
| ^^^^^^
You can’t perform that action at this time.
0 commit comments