]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-close-object-into-object-4.rs
2 // ignore-compare-mode-nll
3 //[nll] compile-flags: -Z borrowck=mir
7 struct B
<'a
, T
:'a
>(&'
a (dyn A
<T
> + 'a
));
10 impl<'a
, T
> X
for B
<'a
, T
> {}
12 fn i
<'a
, T
, U
>(v
: Box
<dyn A
<U
>+'a
>) -> Box
<dyn X
+ '
static> {
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]