Rollup merge of #63560 - Centril:mv-generator-test, r=petrochenkov
move test that shouldn't be in test/run-pass/ We no longer test `src/test/run-pass/`; the proper way now is `// run-pass` in `src/test/ui/` r? @petrochenkov
This commit is contained in:
commit
d11cf775b7
1 changed files with 2 additions and 0 deletions
19
src/test/ui/generator/niche-in-generator.rs
Normal file
19
src/test/ui/generator/niche-in-generator.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Test that niche finding works with captured generator upvars.
|
||||
|
||||
// run-pass
|
||||
|
||||
#![feature(generators)]
|
||||
|
||||
use std::mem::size_of_val;
|
||||
|
||||
fn take<T>(_: T) {}
|
||||
|
||||
fn main() {
|
||||
let x = false;
|
||||
let gen1 = || {
|
||||
yield;
|
||||
take(x);
|
||||
};
|
||||
|
||||
assert_eq!(size_of_val(&gen1), size_of_val(&Some(gen1)));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue