// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // 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) //~ ERROR cannot infer //~^ WARNING E0398 } fn load1<'a,'b>(a: &'a MyBox, b: &'b MyBox) -> &'b MyBox { a //~^ ERROR cannot infer //~| ERROR mismatched types } fn main() { }