]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 | 2 | #![allow(unused_variables)] |
85aaf69f | 3 | #![feature(optin_builtin_traits)] |
223e47cc | 4 | |
85aaf69f SL |
5 | use std::marker::Send; |
6 | ||
7 | pub struct WaitToken; | |
8 | impl !Send for WaitToken {} | |
223e47cc | 9 | |
85aaf69f SL |
10 | pub struct Test<T>(T); |
11 | unsafe impl<T: 'static> Send for Test<T> {} | |
223e47cc | 12 | |
85aaf69f SL |
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 | }); | |
223e47cc | 21 | } |