summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-29861.rs
blob: 58f8eb5362c2e48ebe911dcc7b51bb4316196200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub trait MakeRef<'a> {
    type Ref;
}
impl<'a, T: 'a> MakeRef<'a> for T {
    type Ref = &'a T;
}

pub trait MakeRef2 {
    type Ref2;
}
impl<'a, T: 'a> MakeRef2 for T {
//~^ ERROR the lifetime parameter `'a` is not constrained
    type Ref2 = <T as MakeRef<'a>>::Ref;
}

fn foo() -> <String as MakeRef2>::Ref2 { &String::from("foo") }

fn main() {
    println!("{}", foo());
}