Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
17
tests/ui/generator/yield-in-initializer.rs
Normal file
17
tests/ui/generator/yield-in-initializer.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(generators)]
|
||||
|
||||
fn main() {
|
||||
static || { //~ WARN unused generator 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