]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/user-annotations/type-annotation-with-hrtb.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / nll / user-annotations / type-annotation-with-hrtb.rs
1 // Regression test for issue #69490
2
3 // check-pass
4
5 pub trait Trait<T> {
6     const S: &'static str;
7 }
8
9 impl<T> Trait<()> for T
10 where
11     T: for<'a> Trait<&'a ()>,
12 {
13     // Use of `T::S` here caused an ICE
14     const S: &'static str = T::S;
15 }
16
17 // Some similar cases that didn't ICE:
18
19 impl<'a, T> Trait<()> for (T,)
20 where
21     T: Trait<&'a ()>,
22 {
23     const S: &'static str = T::S;
24 }
25
26 impl<T> Trait<()> for [T; 1]
27 where
28     T: Trait<for<'a> fn(&'a ())>,
29 {
30     const S: &'static str = T::S;
31 }
32
33 fn main() {}