blob: eb824def24687e19502ab4d94c0368de4a0956e5 [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