Closed
Description
Error in next case could be more helpful
struct Foo<'a> {
s: &'a mut String
}
impl<'a> Foo<'a> {
fn f(&self) {
self.s.push('x');
}
}
fn main() {}
error:
error[E0389]: cannot borrow data mutably in a `&` reference
--> 2.rs:7:9
|
7 | self.s.push('x');
| ^^^^^^ assignment into an immutable reference