]>
Commit | Line | Data |
---|---|---|
04454e1e FG |
1 | // revisions: base nll |
2 | // ignore-compare-mode-nll | |
3 | //[nll] compile-flags: -Z borrowck=mir | |
4 | ||
9346a6ac | 5 | trait A<T> { } |
c295e0f8 | 6 | |
dc9dc135 | 7 | struct B<'a, T:'a>(&'a (dyn A<T> + 'a)); |
223e47cc | 8 | |
9346a6ac | 9 | trait X { } |
85aaf69f SL |
10 | impl<'a, T> X for B<'a, T> {} |
11 | ||
dc9dc135 | 12 | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> { |
04454e1e FG |
13 | Box::new(B(&*v)) as Box<dyn X> |
14 | //[base]~^ ERROR E0759 | |
15 | //[nll]~^^ ERROR the parameter type `U` may not live long enough [E0310] | |
16 | //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] | |
17 | //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] | |
18 | //[nll]~| ERROR lifetime may not live long enough | |
19 | //[nll]~| ERROR cannot return value referencing local data `*v` [E0515] | |
20 | //[nll]~| ERROR the parameter type `U` may not live long enough [E0310] | |
21 | ||
223e47cc LB |
22 | } |
23 | ||
85aaf69f | 24 | fn main() {} |