blob: 15e53f1b54de510d6b5a7e3ebbb96f08c657a30a [file] [log] [blame]
error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
--> $DIR/regions-close-object-into-object-4.rs:20:11
|
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
| ^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 19:6...
--> $DIR/regions-close-object-into-object-4.rs:19:6
|
LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
| ^^
note: ...so that the type `(dyn A<U> + 'a)` is not borrowed for too long
--> $DIR/regions-close-object-into-object-4.rs:20:11
|
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
| ^^^
= note: but, the lifetime must be valid for the static lifetime...
= note: ...so that the expression is assignable:
expected std::boxed::Box<(dyn X + 'static)>
found std::boxed::Box<dyn X>
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.