rust/tests/ui/coroutine/static-not-unpin.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
344 B
Rust
Raw Normal View History

// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
2018-11-04 21:07:55 +00:00
// normalize-stderr-test "std::pin::Unpin" -> "std::marker::Unpin"
2018-11-04 21:07:55 +00:00
use std::marker::Unpin;
fn assert_unpin<T: Unpin>(_: T) {
}
fn main() {
2023-10-19 21:46:28 +00:00
let mut coroutine = static || {
2018-11-04 21:07:55 +00:00
yield;
};
2023-10-19 21:46:28 +00:00
assert_unpin(coroutine); //~ ERROR E0277
2018-11-04 21:07:55 +00:00
}