rust/src/test/ui/traits/trait-bounds-sugar.rs

20 lines
275 B
Rust
Raw Normal View History

// Tests for "default" bounds inferred for traits with no bounds list.
2015-04-18 00:12:20 -05:00
trait Foo {}
fn a(_x: Box<Foo+Send>) {
}
fn b(_x: &'static (Foo+'static)) {
}
fn c(x: Box<Foo+Sync>) {
a(x); //~ ERROR mismatched types
}
fn d(x: &'static (Foo+Sync)) {
b(x);
}
2014-02-06 16:38:33 -06:00
fn main() {}