Skip to content

Commit 1e2feb9

Browse files
committed
make must_not_suspend allow-by-default until edge cases are ironed out
1 parent 55111d6 commit 1e2feb9

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ declare_lint! {
348348
/// `MutexGuard`'s)
349349
///
350350
pub MUST_NOT_SUSPEND,
351-
Warn,
351+
Allow,
352352
"use of a `#[must_not_suspend]` value across a yield point",
353353
}
354354

src/test/ui/lint/must_not_suspend/warn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// edition:2018
22
// run-pass
33
#![feature(must_not_suspend)]
4+
#![warn(must_not_suspend)]
45

56
#[must_not_suspend = "You gotta use Umm's, ya know?"]
67
struct Umm {

src/test/ui/lint/must_not_suspend/warn.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
warning: `Umm` held across a suspend point, but should not be
2-
--> $DIR/warn.rs:20:9
2+
--> $DIR/warn.rs:21:9
33
|
44
LL | let _guard = bar();
55
| ^^^^^^
66
LL | other().await;
77
| ------------- the value is held across this suspend point
88
|
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+
| ^^^^^^^^^^^^^^^^
1014
note: You gotta use Umm's, ya know?
11-
--> $DIR/warn.rs:20:9
15+
--> $DIR/warn.rs:21:9
1216
|
1317
LL | let _guard = bar();
1418
| ^^^^^^
1519
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
1721
|
1822
LL | let _guard = bar();
1923
| ^^^^^^

0 commit comments

Comments
 (0)