File tree 3 files changed +37
-10
lines changed
src/test/ui/lint/must_not_suspend
3 files changed +37
-10
lines changed Original file line number Diff line number Diff line change
1
+ error: reference to `Umm` held across a suspend point, but should not be
2
+ --> $DIR/ref.rs:21:13
3
+ |
4
+ LL | let guard = &mut self.u;
5
+ | ^^^^^
6
+ LL |
7
+ LL | other().await;
8
+ | ------ the value is held across this suspend point
9
+ |
10
+ note: the lint level is defined here
11
+ --> $DIR/ref.rs:6:9
12
+ |
13
+ LL | #![deny(must_not_suspend)]
14
+ | ^^^^^^^^^^^^^^^^
15
+ note: You gotta use Umm's, ya know?
16
+ --> $DIR/ref.rs:21:13
17
+ |
18
+ LL | let guard = &mut self.u;
19
+ | ^^^^^
20
+ help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
21
+ --> $DIR/ref.rs:21:13
22
+ |
23
+ LL | let guard = &mut self.u;
24
+ | ^^^^^
25
+
26
+ error: aborting due to previous error
27
+
Original file line number Diff line number Diff line change 1
1
error: `Umm` held across a suspend point, but should not be
2
- --> $DIR/ref.rs:18 :26
2
+ --> $DIR/ref.rs:21 :26
3
3
|
4
4
LL | let guard = &mut self.u;
5
5
| ^^^^^^
@@ -8,17 +8,17 @@ LL | other().await;
8
8
| ------ the value is held across this suspend point
9
9
|
10
10
note: the lint level is defined here
11
- --> $DIR/ref.rs:3 :9
11
+ --> $DIR/ref.rs:6 :9
12
12
|
13
13
LL | #![deny(must_not_suspend)]
14
14
| ^^^^^^^^^^^^^^^^
15
15
note: You gotta use Umm's, ya know?
16
- --> $DIR/ref.rs:18 :26
16
+ --> $DIR/ref.rs:21 :26
17
17
|
18
18
LL | let guard = &mut self.u;
19
19
| ^^^^^^
20
20
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
21
- --> $DIR/ref.rs:18 :26
21
+ --> $DIR/ref.rs:21 :26
22
22
|
23
23
LL | let guard = &mut self.u;
24
24
| ^^^^^^
Original file line number Diff line number Diff line change 1
1
// edition:2018
2
+ // revisions: no_drop_tracking drop_tracking
3
+ // [drop_tracking] compile-flags: -Zdrop-tracking=yes
4
+ // [no_drop_tracking] compile-flags: -Zdrop-tracking=no
2
5
#![ feature( must_not_suspend) ]
3
6
#![ deny( must_not_suspend) ]
4
7
5
8
#[ must_not_suspend = "You gotta use Umm's, ya know?" ]
6
9
struct Umm {
7
- i : i64
10
+ i : i64 ,
8
11
}
9
12
10
13
struct Bar {
@@ -19,11 +22,8 @@ impl Bar {
19
22
20
23
other ( ) . await ;
21
24
22
- * guard = Umm {
23
- i : 2
24
- }
25
+ * guard = Umm { i : 2 }
25
26
}
26
27
}
27
28
28
- fn main ( ) {
29
- }
29
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments