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