mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
13 lines
210 B
Rust
13 lines
210 B
Rust
struct Qux<'a> {
|
|
s: &'a String
|
|
}
|
|
|
|
impl<'a> Qux<'a> {
|
|
fn f(&self) {
|
|
self.s.push('x');
|
|
//~^ ERROR cannot borrow `*self.s` as mutable, as it is behind a `&` reference
|
|
}
|
|
}
|
|
|
|
fn main() {}
|