2013-06-20 18:23:25 -04:00
|
|
|
// Tests for "default" bounds inferred for traits with no bounds list.
|
|
|
|
|
2015-04-17 22:12:20 -07:00
|
|
|
trait Foo {}
|
2013-06-20 18:23:25 -04:00
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn a(_x: Box<dyn Foo + Send>) {
|
2013-06-20 18:23:25 -04:00
|
|
|
}
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn b(_x: &'static (dyn Foo + 'static)) {
|
2013-06-20 18:23:25 -04:00
|
|
|
}
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn c(x: Box<dyn Foo + Sync>) {
|
2014-08-27 21:46:52 -04:00
|
|
|
a(x); //~ ERROR mismatched types
|
2013-06-20 18:23:25 -04:00
|
|
|
}
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn d(x: &'static (dyn Foo + Sync)) {
|
2015-02-12 09:37:52 -05:00
|
|
|
b(x);
|
2013-06-20 18:23:25 -04:00
|
|
|
}
|
|
|
|
|
2014-02-07 00:38:33 +02:00
|
|
|
fn main() {}
|