diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-06-29 22:47:01 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-06-29 22:47:01 +0500 |
| commit | 4b6c3d923f9c9ec869bfc77e6c08e98f9de87ac8 (patch) | |
| tree | 5b865f8b45d45704ef47e1a0f911c41d59672050 /tests/ui/traits/enum-negative-sync-impl.rs | |
| parent | 5ca574e85b67cec0a6fc3fddfe398cbe676c9c69 (diff) | |
| download | rust-4b6c3d923f9c9ec869bfc77e6c08e98f9de87ac8.tar.gz rust-4b6c3d923f9c9ec869bfc77e6c08e98f9de87ac8.zip | |
moved & deleted some tests
Diffstat (limited to 'tests/ui/traits/enum-negative-sync-impl.rs')
| -rw-r--r-- | tests/ui/traits/enum-negative-sync-impl.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/traits/enum-negative-sync-impl.rs b/tests/ui/traits/enum-negative-sync-impl.rs new file mode 100644 index 00000000000..44bf1913e7a --- /dev/null +++ b/tests/ui/traits/enum-negative-sync-impl.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] +} |
