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.

20 lines
437 B
Rust
Raw Normal View History

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
2023-12-14 12:11:28 +00:00
//@[next] compile-flags: -Znext-solver
#![feature(coroutines, stmt_expr_attributes)]
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) {}
2018-11-04 21:07:55 +00:00
fn main() {
let mut coroutine = #[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
}