2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(unused_variables)]
|
2020-01-09 10:56:38 +00:00
|
|
|
#![feature(negative_impls)]
|
2015-01-11 14:51:52 +00:00
|
|
|
|
|
|
|
use std::marker::Send;
|
|
|
|
|
|
|
|
pub struct WaitToken;
|
|
|
|
impl !Send for WaitToken {}
|
|
|
|
|
2022-07-25 20:36:03 +00:00
|
|
|
pub struct Test<T>(#[allow(unused_tuple_struct_fields)] T);
|
2015-01-11 14:51:52 +00:00
|
|
|
unsafe impl<T: 'static> Send for Test<T> {}
|
|
|
|
|
|
|
|
pub fn spawn<F>(_: F) -> () where F: FnOnce(), F: Send + 'static {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let wt = Test(WaitToken);
|
|
|
|
spawn(move || {
|
|
|
|
let x = wt;
|
|
|
|
println!("Hello, World!");
|
|
|
|
});
|
|
|
|
}
|