1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![allow(unused_variables)]
13 fn make_any<T>() -> T { loop {} }
18 fn method(&'a self) { }
21 fn method1<'a,'b,T>(x: &'a T, y: &'b T)
22 where T : for<'z> Trait<'z>, 'a : 'b
24 // Note that &'static T <: &'a T.
25 let a: <T as Trait<'a>>::Type = make_any();
26 let b: <T as Trait<'b>>::Type = make_any();
27 let _c: <T as Trait<'a>>::Type = a;
30 fn method2<'a,'b,T>(x: &'a T, y: &'b T)
31 where T : for<'z> Trait<'z>, 'a : 'b
33 // Note that &'static T <: &'a T.
34 let a: <T as Trait<'a>>::Type = make_any();
35 let b: <T as Trait<'b>>::Type = make_any();
36 let _c: <T as Trait<'b>>::Type = a; //~ ERROR E0623
39 fn method3<'a,'b,T>(x: &'a T, y: &'b T)
40 where T : for<'z> Trait<'z>, 'a : 'b
42 // Note that &'static T <: &'a T.
43 let a: <T as Trait<'a>>::Type = make_any();
44 let b: <T as Trait<'b>>::Type = make_any();
45 let _c: <T as Trait<'a>>::Type = b; //~ ERROR E0623
48 fn method4<'a,'b,T>(x: &'a T, y: &'b T)
49 where T : for<'z> Trait<'z>, 'a : 'b
51 // Note that &'static T <: &'a T.
52 let a: <T as Trait<'a>>::Type = make_any();
53 let b: <T as Trait<'b>>::Type = make_any();
54 let _c: <T as Trait<'b>>::Type = b;