Rename generator
folder
This commit is contained in:
parent
af93c20c06
commit
5c1872d7ae
175 changed files with 0 additions and 0 deletions
17
tests/ui/coroutine/yield-in-initializer.rs
Normal file
17
tests/ui/coroutine/yield-in-initializer.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(coroutines)]
|
||||
|
||||
fn main() {
|
||||
static || { //~ WARN unused coroutine that must be used
|
||||
loop {
|
||||
// Test that `opt` is not live across the yield, even when borrowed in a loop
|
||||
// See https://github.com/rust-lang/rust/issues/52792
|
||||
let opt = {
|
||||
yield;
|
||||
true
|
||||
};
|
||||
let _ = &opt;
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue