-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// edition:2018 | ||
#![feature(must_not_suspend)] | ||
#![deny(must_not_suspend)] | ||
|
||
#[must_not_suspend] | ||
struct No {} | ||
|
||
async fn shushspend() {} | ||
|
||
async fn wheeee<T>(t: T) { | ||
shushspend().await; | ||
drop(t); | ||
} | ||
|
||
async fn yes() { | ||
wheeee(No {}).await; //~ ERROR `No` held across | ||
} | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error: `No` held across a suspend point, but should not be | ||
--> $DIR/dedup.rs:16:12 | ||
| | ||
LL | wheeee(No {}).await; | ||
| -------^^^^^------- the value is held across this suspend point | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/dedup.rs:3:9 | ||
| | ||
LL | #![deny(must_not_suspend)] | ||
| ^^^^^^^^^^^^^^^^ | ||
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point | ||
--> $DIR/dedup.rs:16:12 | ||
| | ||
LL | wheeee(No {}).await; | ||
| ^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters