blob: 154b149b72073f58925e624d84df03c3c1b8e1c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
struct Bar<'a> {
s: &'a String,
// use wonky spaces to ensure we are creating the span correctly
longer_name: & 'a Vec<u8>
}
impl<'a> Bar<'a> {
fn f(&mut self) {
self.s.push('x');
//~^ ERROR cannot borrow `*self.s` as mutable, as it is behind a `&` reference
self.longer_name.push(13);
//~^ ERROR cannot borrow `*self.longer_name` as mutable, as it is behind a `&` reference
}
}
fn main() {}
|