summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/user-annotations/type-annotation-with-hrtb.rs
blob: 1f7c060386bd0a27a1373b03d44ddd4ef24c2fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Regression test for issue #69490

// check-pass

pub trait Trait<T> {
    const S: &'static str;
}

impl<T> Trait<()> for T
where
    T: for<'a> Trait<&'a ()>,
{
    // Use of `T::S` here caused an ICE
    const S: &'static str = T::S;
}

// Some similar cases that didn't ICE:

impl<'a, T> Trait<()> for (T,)
where
    T: Trait<&'a ()>,
{
    const S: &'static str = T::S;
}

impl<T> Trait<()> for [T; 1]
where
    T: Trait<for<'a> fn(&'a ())>,
{
    const S: &'static str = T::S;
}

fn main() {}