]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-outlives-projection-trait-def.rs
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / ui / regions / regions-outlives-projection-trait-def.rs
1 // Test that `<F as Foo<'a>>::Type: 'b`, where `trait Foo<'a> { Type:
2 // 'a; }`, does not require that `F: 'b`.
3
4 // check-pass
5 #![allow(dead_code)]
6
7 trait SomeTrait<'a> {
8     type Type: 'a;
9 }
10
11 impl<'a: 'c, 'c, T> SomeTrait<'a> for &'c T where T: SomeTrait<'a> {
12     type Type = <T as SomeTrait<'a>>::Type;
13     //          ~~~~~~~~~~~~~~~~~~~~~~~~~~
14     //                       |
15     // Note that this type must outlive 'a, due to the trait
16     // definition.  If we fall back to OutlivesProjectionComponents
17     // here, then we would require that `T:'a`, which is too strong.
18 }
19
20
21 fn main() { }