Closed
Description
(Sorry for the bad title)
trait Fun {
type Output;
fn call<'x>(&'x self) -> Self::Output;
}
struct Holder { x: String }
impl<'a> Fun for Holder {
type Output = &'a str;
fn call<'b>(&'b self) -> &'b str {
&self.x[]
}
}
This compiles even though the trait's definition should require call
's signature in the impl to be fn call<'b>(&'b self) -> &'a str
.