mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
22 lines
443 B
Rust
22 lines
443 B
Rust
// revisions: current next
|
|
//[next] compile-flags: -Znext-solver
|
|
// run-pass
|
|
|
|
#![feature(coroutines, coroutine_trait)]
|
|
#![allow(dropping_copy_types)]
|
|
|
|
use std::marker::PhantomPinned;
|
|
|
|
fn assert_unpin<G: Unpin>(_: G) {
|
|
}
|
|
|
|
fn main() {
|
|
// Even though this coroutine holds a `PhantomPinned` in its environment, it
|
|
// remains `Unpin`.
|
|
assert_unpin(|| {
|
|
let pinned = PhantomPinned;
|
|
yield;
|
|
drop(pinned);
|
|
});
|
|
}
|