blob: 17e23f5bcd2faf50bf8cc2537f75ef04a3be675d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
// run-pass
#![feature(generators, generator_trait)]
use std::marker::{PhantomPinned, Unpin};
fn assert_unpin<G: Unpin>(_: G) {
}
fn main() {
// Even though this generator holds a `PhantomPinned` in its environment, it
// remains `Unpin`.
assert_unpin(|| {
let pinned = PhantomPinned;
yield;
drop(pinned);
});
}
|