diff options
Diffstat (limited to 'tests/ui/borrowck/issue-93093.rs')
-rw-r--r-- | tests/ui/borrowck/issue-93093.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/borrowck/issue-93093.rs b/tests/ui/borrowck/issue-93093.rs new file mode 100644 index 000000000..f4db5ecaf --- /dev/null +++ b/tests/ui/borrowck/issue-93093.rs @@ -0,0 +1,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(); +} |