]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no_share-enum.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / 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 }