]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-implied-bounds-projection-gap-2.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / regions / regions-implied-bounds-projection-gap-2.rs
1 // Along with the other tests in this series, illustrates the
2 // "projection gap": in this test, we know that `T: 'x`, and that is
3 // enough to conclude that `T::Foo: 'x`.
4
5 // check-pass
6 #![allow(dead_code)]
7 #![allow(unused_variables)]
8
9 trait Trait1<'x> {
10 type Foo;
11 }
12
13 // calling this fn should trigger a check that the type argument
14 // supplied is well-formed.
15 fn wf<T>() { }
16
17 fn func<'x, T:Trait1<'x>>(t: &'x T)
18 {
19 wf::<&'x T::Foo>();
20 }
21
22
23 fn main() { }