2013-08-19 21:15:25 +00: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 23:40:04 +00:00
|
|
|
trait Foo : Send+Sync { }
|
2013-08-16 22:21:02 +00:00
|
|
|
|
2018-02-11 05:01:49 +00:00
|
|
|
impl <T: Sync+'static> Foo for (T,) { }
|
2018-06-09 23:53:36 +00:00
|
|
|
//~^ ERROR `T` cannot be sent between threads safely [E0277]
|
2013-08-16 22:21:02 +00:00
|
|
|
|
2018-02-11 05:01:49 +00:00
|
|
|
impl <T: Send> Foo for (T,T) { }
|
|
|
|
//~^ ERROR `T` cannot be shared between threads safely [E0277]
|
2013-08-16 22:21:02 +00:00
|
|
|
|
2014-08-05 23:40:04 +00:00
|
|
|
impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
|
2013-08-16 22:21:02 +00:00
|
|
|
|
|
|
|
fn main() { }
|