]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-close-object-into-object-4.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-close-object-into-object-4.rs
CommitLineData
04454e1e
FG
1// revisions: base nll
2// ignore-compare-mode-nll
3//[nll] compile-flags: -Z borrowck=mir
4
9346a6ac 5trait A<T> { }
c295e0f8 6
dc9dc135 7struct B<'a, T:'a>(&'a (dyn A<T> + 'a));
223e47cc 8
9346a6ac 9trait X { }
85aaf69f
SL
10impl<'a, T> X for B<'a, T> {}
11
dc9dc135 12fn 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 24fn main() {}