summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs
blob: 0bc611c26caa2b058ecae4d221d2844550bd9ea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass
#![allow(unused_variables)]
#![feature(negative_impls)]

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!");
    });
}