blob: f4db5ecafac40a6be0600830a20bff70cc3de149 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// edition:2018
struct S {
foo: usize,
}
impl S {
async fn bar(&self) { //~ HELP consider changing this to be a mutable reference
//~| SUGGESTION &mut self
self.foo += 1; //~ ERROR cannot assign to `self.foo`, which is behind a `&` reference [E0594]
}
}
fn main() {
S { foo: 1 }.bar();
}
|