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