about summary refs log tree commit diff
path: root/tests/ui/borrowck/issue-93093.rs
blob: 1521b2072389217e71867e3c0b605150513023ed (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.foo += 1; //~ ERROR cannot assign to `self.foo`, which is behind a `&` reference [E0594]
    }
}

fn main() {
    S { foo: 1 }.bar();
}