Closed
Description
trait Foo {
fn a(&self) -> &'self str;
fn b(&self) -> &'self str;
}
impl Foo for &'self str {
fn a(&self) -> &'self str {
*self
}
fn b(&self) -> &'self str {
*self
}
}
fn main () {
let c = "defg";
c.a();
c.b();
c.a().b(); // error: illegal borrow: borrowed value does not live long enough
}
Metadata
Metadata
Assignees
Labels
No labels