]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/negative-impls/negated-auto-traits-rpass.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / traits / negative-impls / negated-auto-traits-rpass.rs
1 // run-pass
2 #![allow(unused_variables)]
3 #![feature(negative_impls)]
4
5 use std::marker::Send;
6
7 pub struct WaitToken;
8 impl !Send for WaitToken {}
9
10 pub struct Test<T>(#[allow(unused_tuple_struct_fields)] T);
11 unsafe impl<T: 'static> Send for Test<T> {}
12
13 pub fn spawn<F>(_: F) -> () where F: FnOnce(), F: Send + 'static {}
14
15 fn main() {
16 let wt = Test(WaitToken);
17 spawn(move || {
18 let x = wt;
19 println!("Hello, World!");
20 });
21 }