6 // Here the lifetime parameter of direct is bound by the fn()
7 g: Box<FnOnce(Direct) + 'static>
10 struct Indirect2<'a> {
11 // But here it is set to 'a
12 g: Box<FnOnce(Direct<'a>) + 'static>
15 fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } //~ ERROR mismatched types
17 fn take_indirect1(p: Indirect1) -> Indirect1 { p }
19 fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } //~ ERROR mismatched types
20 //~| expected type `Indirect2<'b>`
21 //~| found type `Indirect2<'a>`
22 //~| ERROR mismatched types
23 //~| expected type `Indirect2<'b>`
24 //~| found type `Indirect2<'a>`