mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
22 lines
445 B
Rust
22 lines
445 B
Rust
// run-pass
|
|
#![allow(unused_variables)]
|
|
#![feature(negative_impls)]
|
|
|
|
use std::marker::Send;
|
|
|
|
pub struct WaitToken;
|
|
impl !Send for WaitToken {}
|
|
|
|
pub struct Test<T>(#[allow(unused_tuple_struct_fields)] T);
|
|
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!");
|
|
});
|
|
}
|