]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/no_send-struct.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / traits / no_send-struct.rs
1 #![feature(negative_impls)]
2
3 use std::marker::Send;
4
5 struct Foo {
6     a: isize,
7 }
8
9 impl !Send for Foo {}
10
11 fn bar<T: Send>(_: T) {}
12
13 fn main() {
14     let x = Foo { a: 5 };
15     bar(x);
16     //~^ ERROR `Foo` cannot be sent between threads safely
17 }