2019-08-02 20:06:15 -05:00
|
|
|
// Test that niche finding works with captured generator upvars.
|
|
|
|
|
2019-08-14 11:04:33 -05:00
|
|
|
// run-pass
|
|
|
|
|
2019-08-02 20:06:15 -05:00
|
|
|
#![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)));
|
|
|
|
}
|