]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-52992.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-52992.rs
1 // Regression test for an NLL-related ICE (#52992) -- computing
2 // implied bounds was causing outlives relations that were not
3 // properly handled.
4 //
5 // check-pass
6
7 fn main() {}
8
9 fn fail<'a>() -> Struct<'a, Generic<()>> {
10     Struct(&Generic(()))
11 }
12
13 struct Struct<'a, T>(&'a T) where
14     T: Trait + 'a,
15     T::AT: 'a; // only fails with this bound
16
17 struct Generic<T>(T);
18
19 trait Trait {
20     type AT;
21 }
22
23 impl<T> Trait for Generic<T> {
24     type AT = T; // only fails with a generic AT
25 }