-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
suggest to add move keyword for generator
- Loading branch information
Showing
5 changed files
with
47 additions
and
5 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
12 changes: 12 additions & 0 deletions
12
src/test/ui/async-await/async-borrowck-escaping-block-error.fixed
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:2018 | ||
// run-rustfix | ||
|
||
fn foo() -> Box<impl std::future::Future<Output = u32>> { | ||
let x = 0u32; | ||
Box::new(async move { x } ) | ||
//~^ ERROR E0373 | ||
} | ||
|
||
fn main() { | ||
let _foo = foo(); | ||
} |
7 changes: 5 additions & 2 deletions
7
src/test/ui/async-await/async-borrowck-escaping-block-error.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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// edition:2018 | ||
#![feature(async_closure,async_await)] | ||
// run-rustfix | ||
|
||
fn foo() -> Box<impl std::future::Future<Output = u32>> { | ||
let x = 0u32; | ||
Box::new(async { x } ) | ||
//~^ ERROR E0373 | ||
} | ||
|
||
fn main() {} | ||
fn main() { | ||
let _foo = foo(); | ||
} |
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