]> git.lizzy.rs Git - rust.git/blob - tests/ui/no_share-enum.rs
Rollup merge of #106734 - albertlarsan68:deny-src-tests-in-tidy, r=Nilstrieb
[rust.git] / tests / ui / no_share-enum.rs
1 #![feature(negative_impls)]
2
3 use std::marker::Sync;
4
5 struct NoSync;
6 impl !Sync for NoSync {}
7
8 enum Foo { A(NoSync) }
9
10 fn bar<T: Sync>(_: T) {}
11
12 fn main() {
13     let x = Foo::A(NoSync);
14     bar(x);
15     //~^ ERROR `NoSync` cannot be shared between threads safely [E0277]
16 }