Closed
Description
This code results in a horrible error message:
use std::ops::Deref;
trait Trait {}
struct Struct;
impl Deref for Struct {
type Target = Trait;
fn deref(&self) -> &Trait {
unimplemented!();
}
}
<anon>:8:5: 10:6 error: method `deref` has an incompatible type for trait:
expected bound lifetime parameter ,
found concrete lifetime [E0053]
<anon>: 8 fn deref(&self) -> &Trait {
<anon>: 9 unimplemented!();
<anon>:10 }
<anon>:8:5: 10:6 help: see the detailed explanation for E0053
In particular, note the missing lifetime name on the second line of the error message.