File tree Expand file tree Collapse file tree 3 files changed +37
-10
lines changed
src/test/ui/lint/must_not_suspend Expand file tree Collapse file tree 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 11error: `Umm` held across a suspend point, but should not be
2- --> $DIR/ref.rs:18 :26
2+ --> $DIR/ref.rs:21 :26
33 |
44LL | let guard = &mut self.u;
55 | ^^^^^^
@@ -8,17 +8,17 @@ LL | other().await;
88 | ------ the value is held across this suspend point
99 |
1010note: the lint level is defined here
11- --> $DIR/ref.rs:3 :9
11+ --> $DIR/ref.rs:6 :9
1212 |
1313LL | #![deny(must_not_suspend)]
1414 | ^^^^^^^^^^^^^^^^
1515note: You gotta use Umm's, ya know?
16- --> $DIR/ref.rs:18 :26
16+ --> $DIR/ref.rs:21 :26
1717 |
1818LL | let guard = &mut self.u;
1919 | ^^^^^^
2020help: 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
2222 |
2323LL | let guard = &mut self.u;
2424 | ^^^^^^
Original file line number Diff line number Diff line change 11// 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
25#![ feature( must_not_suspend) ]
36#![ deny( must_not_suspend) ]
47
58#[ must_not_suspend = "You gotta use Umm's, ya know?" ]
69struct Umm {
7- i : i64
10+ i : i64 ,
811}
912
1013struct Bar {
@@ -19,11 +22,8 @@ impl Bar {
1922
2023 other ( ) . await ;
2124
22- * guard = Umm {
23- i : 2
24- }
25+ * guard = Umm { i : 2 }
2526 }
2627}
2728
28- fn main ( ) {
29- }
29+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments