blob: a5dde3912cc00efb54f2952971a5a5beadf3c5fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
// run-pass
#![feature(generators, generator_trait)]
#![allow(dropping_copy_types)]
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);
});
}
|