-
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
1 parent
fa9f77f
commit 4114e9b
Showing
7 changed files
with
144 additions
and
37 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
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,15 @@ | ||
// edition:2021 | ||
|
||
// FIXME(async_closures): This needs a better error message! | ||
|
||
#![feature(async_closure)] | ||
|
||
fn main() { | ||
fn needs_fn<T>(_: impl FnMut() -> T) {} | ||
|
||
let mut x = 1; | ||
needs_fn(async || { | ||
//~^ ERROR async closure does not implement `FnMut` because it captures state from its environment | ||
x += 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,16 @@ | ||
error: async closure does not implement `FnMut` because it captures state from its environment | ||
--> $DIR/not-fn.rs:11:14 | ||
| | ||
LL | needs_fn(async || { | ||
| -------- ^^^^^^^^ | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
note: required by a bound in `needs_fn` | ||
--> $DIR/not-fn.rs:8:28 | ||
| | ||
LL | fn needs_fn<T>(_: impl FnMut() -> T) {} | ||
| ^^^^^^^^^^^^ required by this bound in `needs_fn` | ||
|
||
error: aborting due to 1 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 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