diff options
Diffstat (limited to 'tests/ui/no_share-struct.rs')
-rw-r--r-- | tests/ui/no_share-struct.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/no_share-struct.rs b/tests/ui/no_share-struct.rs new file mode 100644 index 000000000..7d8a36a76 --- /dev/null +++ b/tests/ui/no_share-struct.rs @@ -0,0 +1,14 @@ +#![feature(negative_impls)] + +use std::marker::Sync; + +struct Foo { a: isize } +impl !Sync for Foo {} + +fn bar<T: Sync>(_: T) {} + +fn main() { + let x = Foo { a: 5 }; + bar(x); + //~^ ERROR `Foo` cannot be shared between threads safely [E0277] +} |