blob: 449a5b5fdd4d654c69ebcd8e2314284674ce09fa [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:10:11
|
LL | box B(&*v) as Box<dyn X>
| ^^^
|
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:6...
--> $DIR/regions-close-object-into-object-4.rs:9:6
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn 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:10:11
|
LL | box B(&*v) as Box<dyn X>
| ^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the expression is assignable
--> $DIR/regions-close-object-into-object-4.rs:10:5
|
LL | box B(&*v) as Box<dyn X>
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: 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`.