error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 | LL | box v as Box //~ ERROR cannot infer an appropriate lifetime | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 28:20... --> $DIR/regions-close-over-type-parameter-multiple.rs:28:20 | LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { | ^^ note: ...so that the declared lifetime parameter bounds are satisfied --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 | LL | box v as Box //~ ERROR cannot infer an appropriate lifetime | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: but, the lifetime must be valid for the lifetime 'c as defined on the function body at 28:26... --> $DIR/regions-close-over-type-parameter-multiple.rs:28:26 | LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { | ^^ = note: ...so that the expression is assignable: expected std::boxed::Box<(dyn SomeTrait + 'c)> found std::boxed::Box error: aborting due to previous error For more information about this error, try `rustc --explain E0495`.