1 // Copyright 2014 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 // Check that when we test the supertrait we ensure consistent use of
12 // lifetime parameters. In this case, implementing T2<'a,'b> requires
13 // an impl of T1<'a>, but we have an impl of T1<'b>.
16 fn x(&self) -> &'x isize;
19 trait T2<'x, 'y> : T1<'x> {
20 fn y(&self) -> &'y isize;
28 impl<'a,'b> T1<'b> for S<'a, 'b> {
29 fn x(&self) -> &'b isize {
34 impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { //~ ERROR cannot infer an appropriate lifetime
35 fn y(&self) -> &'b isize {