2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_variables)]
|
2020-01-09 05:56:38 -05:00
|
|
|
#![feature(negative_impls)]
|
2015-01-11 15:51:52 +01:00
|
|
|
|
|
|
|
|
pub struct WaitToken;
|
|
|
|
|
impl !Send for WaitToken {}
|
|
|
|
|
|
2023-12-27 17:11:58 -05:00
|
|
|
pub struct Test<T>(#[allow(dead_code)] T);
|
2015-01-11 15:51:52 +01: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!");
|
|
|
|
|
});
|
|
|
|
|
}
|