blob: 169369c304eb22092fbfebaa2bc3ef638d08c3d3 [file] [log] [blame]
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter in generic type due to conflicting requirements
--> $DIR/mismatched_trait_impl-2.rs:18:5
|
LL | fn deref(&self) -> &Trait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 18:5...
--> $DIR/mismatched_trait_impl-2.rs:18:5
|
LL | / fn deref(&self) -> &Trait {
LL | | unimplemented!();
LL | | }
| |_____^
= note: ...but the lifetime must also be valid for the static lifetime...
= note: ...so that the method type is compatible with trait:
expected fn(&Struct) -> &(dyn Trait + 'static)
found fn(&Struct) -> &dyn Trait
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.