rust/src/test/ui/traits/trait-bounds-sugar.rs
2018-12-25 21:08:33 -07:00

20 lines
275 B
Rust

// Tests for "default" bounds inferred for traits with no bounds list.
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);
}
fn main() {}