rust/tests/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
429 B
Rust
Raw Normal View History

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.
trait Foo : Send+Sync { }
2013-08-16 22:21:02 +00:00
impl <T: Sync+'static> Foo for (T,) { }
//~^ ERROR `T` cannot be sent between threads safely [E0277]
2013-08-16 22:21:02 +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
impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
2013-08-16 22:21:02 +00:00
fn main() { }