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