2013-08-19 16:15:25 -05:00
|
|
|
// Test for traits that inherit from multiple builtin kinds at once,
|
|
|
|
// testing that all such kinds must be present on implementing types.
|
|
|
|
|
2014-08-05 18:40:04 -05:00
|
|
|
trait Foo : Send+Sync { }
|
2013-08-16 17:21:02 -05:00
|
|
|
|
2018-02-10 23:01:49 -06:00
|
|
|
impl <T: Sync+'static> Foo for (T,) { }
|
2018-06-09 18:53:36 -05:00
|
|
|
//~^ ERROR `T` cannot be sent between threads safely [E0277]
|
2013-08-16 17:21:02 -05:00
|
|
|
|
2018-02-10 23:01:49 -06:00
|
|
|
impl <T: Send> Foo for (T,T) { }
|
|
|
|
//~^ ERROR `T` cannot be shared between threads safely [E0277]
|
2013-08-16 17:21:02 -05:00
|
|
|
|
2014-08-05 18:40:04 -05:00
|
|
|
impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
|
2013-08-16 17:21:02 -05:00
|
|
|
|
|
|
|
fn main() { }
|