]> git.lizzy.rs Git - rust.git/blob - tests/ui/no_share-struct.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / 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 }