-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't build by-move body when async closure is tainted
- Loading branch information
1 parent
9afe713
commit bce7c4b
Showing
3 changed files
with
36 additions
and
2 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,18 @@ | ||
//@ edition: 2021 | ||
|
||
#![feature(async_closure)] | ||
|
||
// Ensure that building a by-ref async closure body doesn't ICE when the parent | ||
// body is tainted. | ||
|
||
fn main() { | ||
missing; | ||
//~^ ERROR cannot find value `missing` in this scope | ||
|
||
// We don't do numerical inference fallback when the body is tainted. | ||
// This leads to writeback folding the type of the coroutine-closure | ||
// into an error type, since its signature contains that numerical | ||
// infer var. | ||
let c = async |_| {}; | ||
c(1); | ||
} |
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,9 @@ | ||
error[E0425]: cannot find value `missing` in this scope | ||
--> $DIR/tainted-body-2.rs:9:5 | ||
| | ||
LL | missing; | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |