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