rust/tests/ui/traits/no_send-struct.rs

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

18 lines
243 B
Rust
Raw Normal View History

#![feature(negative_impls)]
2015-01-11 12:14:39 +00:00
use std::marker::Send;
struct Foo {
a: isize,
}
2015-01-11 12:14:39 +00:00
impl !Send for Foo {}
fn bar<T: Send>(_: T) {}
fn main() {
2015-01-11 12:14:39 +00:00
let x = Foo { a: 5 };
2014-02-05 22:33:10 +00:00
bar(x);
//~^ ERROR `Foo` cannot be sent between threads safely
}