fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
976 B24 linesraw
1error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
2  --> $DIR/regions-close-object-into-object-4.rs:10:11
3   |
4LL |     box B(&*v) as Box<dyn X>
5   |           ^^^
6   |
7note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:6...
8  --> $DIR/regions-close-object-into-object-4.rs:9:6
9   |
10LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
11   |      ^^
12note: ...so that the type `(dyn A<U> + 'a)` is not borrowed for too long
13  --> $DIR/regions-close-object-into-object-4.rs:10:11
14   |
15LL |     box B(&*v) as Box<dyn X>
16   |           ^^^
17   = note: but, the lifetime must be valid for the static lifetime...
18   = note: ...so that the expression is assignable:
19           expected std::boxed::Box<(dyn X + 'static)>
20              found std::boxed::Box<dyn X>
21
22error: aborting due to previous error
23
24For more information about this error, try `rustc --explain E0495`.