rust/tests/ui/no_share-struct.rs

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

15 lines
247 B
Rust
Raw Normal View History

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