1 // The dummy functions are used to avoid adding new cfail files.
2 // What happens is that the compiler attempts to squash duplicates and some
3 // errors are not reported. This way, we make sure that, for each function, different
4 // typeck phases are involved and all errors are reported.
6 #![feature(optin_builtin_traits)]
10 struct Outer<T: Send>(T);
14 unsafe impl<T: Send> Sync for Outer2<T> {}
16 fn is_send<T: Send>(_: T) {}
17 fn is_sync<T: Sync>(_: T) {}
21 impl !Send for TestType {}
24 //~^ ERROR `dummy::TestType` cannot be sent between threads safely
25 //~| ERROR `dummy::TestType` cannot be sent between threads safely
30 impl !Send for TestType {}
33 //~^ ERROR `dummy1b::TestType` cannot be sent between threads safely
38 impl !Send for TestType {}
40 is_send((8, TestType));
41 //~^ ERROR `dummy1c::TestType` cannot be sent between threads safely
46 impl !Send for TestType {}
48 is_send(Box::new(TestType));
49 //~^ ERROR `dummy2::TestType` cannot be sent between threads safely
54 impl !Send for TestType {}
56 is_send(Box::new(Outer2(TestType)));
57 //~^ ERROR `dummy3::TestType` cannot be sent between threads safely
62 impl !Send for TestType {}
64 // This will complain about a missing Send impl because `Sync` is implement *just*
65 // for T that are `Send`. Look at #20366 and #19950
66 is_sync(Outer2(TestType));
67 //~^ ERROR `main::TestType` cannot be sent between threads safely