1 // Test a "pass-through" object-lifetime-default that produces errors.
9 struct MyBox<T:?Sized> {
13 fn deref<T>(ss: &T) -> T {
14 // produces the type of a deref without worrying about whether a
15 // move out would actually be legal
19 fn load0(ss: &MyBox<dyn SomeTrait>) -> MyBox<dyn SomeTrait> {
23 fn load1<'a,'b>(a: &'a MyBox<dyn SomeTrait>,
24 b: &'b MyBox<dyn SomeTrait>)
25 -> &'b MyBox<dyn SomeTrait>
27 a //~ ERROR lifetime mismatch
30 fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {
31 load0(ss) //~ ERROR mismatched types