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.

21 lines
506 B
Rust
Raw Normal View History

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver --diagnostic-width=300
//@[current] compile-flags: --diagnostic-width=300
#![feature(coroutines, stmt_expr_attributes)]
2018-11-04 22:07:55 +01:00
//@ normalize-stderr: "std::pin::Unpin" -> "std::marker::Unpin"
2018-11-04 22:07:55 +01:00
use std::marker::Unpin;
fn assert_unpin<T: Unpin>(_: T) {}
2018-11-04 22:07:55 +01:00
fn main() {
let mut coroutine = #[coroutine]
static || {
2018-11-04 22:07:55 +01:00
yield;
};
2023-10-19 21:46:28 +00:00
assert_unpin(coroutine); //~ ERROR E0277
2018-11-04 22:07:55 +01:00
}