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