about summary refs log tree commit diff
path: root/src/test/ui/suggestions
diff options
context:
space:
mode:
authorashtneoi <ashtneoi@gmail.com>2018-07-09 13:33:57 -0700
committerashtneoi <ashtneoi@gmail.com>2018-07-09 13:33:57 -0700
commitdc8ae26c1ee4f95e3baef603506fbaa95cb2ccd1 (patch)
tree08a25f2c70d34949607c15e33120cdaab4ebc4a2 /src/test/ui/suggestions
parenta49b75d2f342f5904d89f34f46dfd621c20da7f7 (diff)
downloadrust-dc8ae26c1ee4f95e3baef603506fbaa95cb2ccd1.tar.gz
rust-dc8ae26c1ee4f95e3baef603506fbaa95cb2ccd1.zip
Fix issue #51515 and update test
Diffstat (limited to 'src/test/ui/suggestions')
-rw-r--r--src/test/ui/suggestions/issue-51515.rs6
-rw-r--r--src/test/ui/suggestions/issue-51515.stderr8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/test/ui/suggestions/issue-51515.rs b/src/test/ui/suggestions/issue-51515.rs
index b5bbf48ddfa..3e0a3b757a3 100644
--- a/src/test/ui/suggestions/issue-51515.rs
+++ b/src/test/ui/suggestions/issue-51515.rs
@@ -12,7 +12,13 @@
 
 fn main() {
     let foo = &16;
+    //~^ HELP consider changing this to be a mutable reference
+    //~| SUGGESTION &mut 16
     *foo = 32;
+    //~^ ERROR cannot assign to `*foo` which is behind a `&` reference
     let bar = foo;
+    //~^ HELP consider changing this to be a mutable reference
+    //~| SUGGESTION &mut i32
     *bar = 64;
+    //~^ ERROR cannot assign to `*bar` which is behind a `&` reference
 }
diff --git a/src/test/ui/suggestions/issue-51515.stderr b/src/test/ui/suggestions/issue-51515.stderr
index 7cdbef1badc..3e7349b5aca 100644
--- a/src/test/ui/suggestions/issue-51515.stderr
+++ b/src/test/ui/suggestions/issue-51515.stderr
@@ -1,14 +1,18 @@
 error[E0594]: cannot assign to `*foo` which is behind a `&` reference
-  --> $DIR/issue-51515.rs:15:5
+  --> $DIR/issue-51515.rs:17:5
    |
 LL |     let foo = &16;
    |               --- help: consider changing this to be a mutable reference: `&mut 16`
+...
 LL |     *foo = 32;
    |     ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
 
 error[E0594]: cannot assign to `*bar` which is behind a `&` reference
-  --> $DIR/issue-51515.rs:17:5
+  --> $DIR/issue-51515.rs:22:5
    |
+LL |     let bar = foo;
+   |         --- help: consider changing this to be a mutable reference: `&mut i32`
+...
 LL |     *bar = 64;
    |     ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written