blob: 5e80c673258b8484432a74442ec7a58020d05ac9 [file] [log] [blame]
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/dyn-trait.rs:20:16
|
LL | static_val(x);
| ^
|
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 19:26...
--> $DIR/dyn-trait.rs:19:26
|
LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
| ^^
= note: ...so that the expression is assignable:
expected std::boxed::Box<dyn std::fmt::Debug>
found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
= note: but, the lifetime must be valid for the static lifetime...
= note: ...so that the types are compatible:
expected StaticTrait
found StaticTrait
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.