File tree 3 files changed +10
-5
lines changed
compiler/rustc_lint_defs/src
src/test/ui/lint/must_not_suspend
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ declare_lint! {
348
348
/// `MutexGuard`'s)
349
349
///
350
350
pub MUST_NOT_SUSPEND ,
351
- Warn ,
351
+ Allow ,
352
352
"use of a `#[must_not_suspend]` value across a yield point" ,
353
353
}
354
354
Original file line number Diff line number Diff line change 1
1
// edition:2018
2
2
// run-pass
3
3
#![ feature( must_not_suspend) ]
4
+ #![ warn( must_not_suspend) ]
4
5
5
6
#[ must_not_suspend = "You gotta use Umm's, ya know?" ]
6
7
struct Umm {
Original file line number Diff line number Diff line change 1
1
warning: `Umm` held across a suspend point, but should not be
2
- --> $DIR/warn.rs:20 :9
2
+ --> $DIR/warn.rs:21 :9
3
3
|
4
4
LL | let _guard = bar();
5
5
| ^^^^^^
6
6
LL | other().await;
7
7
| ------------- the value is held across this suspend point
8
8
|
9
- = note: `#[warn(must_not_suspend)]` on by default
9
+ note: the lint level is defined here
10
+ --> $DIR/warn.rs:4:9
11
+ |
12
+ LL | #![warn(must_not_suspend)]
13
+ | ^^^^^^^^^^^^^^^^
10
14
note: You gotta use Umm's, ya know?
11
- --> $DIR/warn.rs:20 :9
15
+ --> $DIR/warn.rs:21 :9
12
16
|
13
17
LL | let _guard = bar();
14
18
| ^^^^^^
15
19
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
16
- --> $DIR/warn.rs:20 :9
20
+ --> $DIR/warn.rs:21 :9
17
21
|
18
22
LL | let _guard = bar();
19
23
| ^^^^^^
You can’t perform that action at this time.
0 commit comments