rust/tests/ui/did_you_mean/issue-38147-3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
210 B
Rust
Raw Normal View History

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() {}