]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no_share-struct.rs
Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31
[rust.git] / src / test / ui / no_share-struct.rs
1 #![feature(negative_impls)]
2
3 use std::marker::Sync;
4
5 struct Foo { a: isize }
6 impl !Sync for Foo {}
7
8 fn bar<T: Sync>(_: T) {}
9
10 fn main() {
11     let x = Foo { a: 5 };
12     bar(x);
13     //~^ ERROR `Foo` cannot be shared between threads safely [E0277]
14 }