-
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 ICE when we have leftover child captures due to ambiguous closu…
…re params
- Loading branch information
1 parent
7a58674
commit 92cdff1
Showing
5 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
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
12 changes: 12 additions & 0 deletions
12
tests/ui/async-await/async-closures/leftover-captures-due-to-ambiguity.rs
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,12 @@ | ||
//@ edition: 2021 | ||
|
||
#![feature(async_closure)] | ||
|
||
pub fn test(test: &()) { | ||
async |unconstrained| { | ||
//~^ ERROR type annotations needed | ||
(test,) | ||
}; | ||
} | ||
|
||
fn main() {} |
13 changes: 13 additions & 0 deletions
13
tests/ui/async-await/async-closures/leftover-captures-due-to-ambiguity.stderr
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,13 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/leftover-captures-due-to-ambiguity.rs:6:27 | ||
| | ||
LL | async |unconstrained| { | ||
| ___________________________^ | ||
LL | | | ||
LL | | (test,) | ||
LL | | }; | ||
| |_____^ cannot infer type | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |