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 13:14:39 +01:00
use std::marker::Send;
struct Foo {
a: isize,
}
2015-01-11 13:14:39 +01:00
impl !Send for Foo {}
fn bar<T: Send>(_: T) {}
fn main() {
2015-01-11 13:14:39 +01:00
let x = Foo { a: 5 };
2014-02-05 16:33:10 -06:00
bar(x);
//~^ ERROR `Foo` cannot be sent between threads safely
}