]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-early-bound-error.rs
Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
[rust.git] / src / test / ui / regions / regions-early-bound-error.rs
1 // Tests that you can use a fn lifetime parameter as part of
2 // the value for a type parameter in a bound.
3
4 trait GetRef<'a, T> {
5     fn get(&self) -> &'a T;
6 }
7
8 struct Box<'a, T:'a> {
9     t: &'a T
10 }
11
12 impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
13     fn get(&self) -> &'a T {
14         self.t
15     }
16 }
17
18 fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
19     g1.get()
20     //~^ ERROR E0312
21 }
22
23 fn main() {
24 }