summary refs log tree commit diff
path: root/src/test/run-pass/traits/traits-negative-impls.rs
blob: 8664b6a6a6e36c2623176a49203fa6b64d7d3890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-pass
#![allow(unused_variables)]
#![feature(optin_builtin_traits)]

use std::marker::Send;

pub struct WaitToken;
impl !Send for WaitToken {}

pub struct Test<T>(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!");
    });
}