]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-93093.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-93093.rs
1 // edition:2018
2 struct S {
3     foo: usize,
4 }
5 impl S {
6     async fn bar(&self) { //~ HELP consider changing this to be a mutable reference
7         //~| SUGGESTION &mut self
8         self.foo += 1; //~ ERROR cannot assign to `self.foo`, which is behind a `&` reference [E0594]
9     }
10 }
11
12 fn main() {
13     S { foo: 1 }.bar();
14 }