// Test a "pass-through" object-lifetime-default that produces errors. #![allow(dead_code)] trait SomeTrait { fn dummy(&self) { } } struct MyBox { r: Box } fn deref(ss: &T) -> T { // produces the type of a deref without worrying about whether a // move out would actually be legal loop { } } fn load0(ss: &MyBox) -> MyBox { deref(ss) } fn load1<'a,'b>(a: &'a MyBox, b: &'b MyBox) -> &'b MyBox { a //~^ ERROR lifetime may not live long enough } fn load2<'a>(ss: &MyBox) -> MyBox { load0(ss) //~^ ERROR borrowed data escapes outside of function } fn main() { }