about summary refs log tree commit diff
path: root/src/test/ui/self
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-27 23:44:44 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-08-27 23:44:44 +0200
commit42e895d4d99ec7724f3efd632f52170f3f99a5aa (patch)
treeee1a9de1892767097e8a7ce767191648c78ef3a5 /src/test/ui/self
parentdbbe3363c94b120d1eba9cba01dadddd862716b8 (diff)
downloadrust-42e895d4d99ec7724f3efd632f52170f3f99a5aa.tar.gz
rust-42e895d4d99ec7724f3efd632f52170f3f99a5aa.zip
Improve 'mut ' diagnostic.
Diffstat (limited to 'src/test/ui/self')
-rw-r--r--src/test/ui/self/self_type_keyword.rs2
-rw-r--r--src/test/ui/self/self_type_keyword.stderr6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/ui/self/self_type_keyword.rs b/src/test/ui/self/self_type_keyword.rs
index d479905932b..844f13c2f89 100644
--- a/src/test/ui/self/self_type_keyword.rs
+++ b/src/test/ui/self/self_type_keyword.rs
@@ -14,7 +14,7 @@ pub fn main() {
         ref Self => (),
         //~^ ERROR expected identifier, found keyword `Self`
         mut Self => (),
-        //~^ ERROR `mut` must be attached to each individual binding
+        //~^ ERROR `mut` must be followed by a named binding
         //~| ERROR cannot find unit struct/variant or constant `Self`
         ref mut Self => (),
         //~^ ERROR expected identifier, found keyword `Self`
diff --git a/src/test/ui/self/self_type_keyword.stderr b/src/test/ui/self/self_type_keyword.stderr
index fdae06ccdd9..bb631194bf3 100644
--- a/src/test/ui/self/self_type_keyword.stderr
+++ b/src/test/ui/self/self_type_keyword.stderr
@@ -10,11 +10,13 @@ error: expected identifier, found keyword `Self`
 LL |         ref Self => (),
    |             ^^^^ expected identifier, found keyword
 
-error: `mut` must be attached to each individual binding
+error: `mut` must be followed by a named binding
   --> $DIR/self_type_keyword.rs:16:9
    |
 LL |         mut Self => (),
-   |         ^^^^^^^^ help: add `mut` to each binding: `Self`
+   |         ^^^^^^^^ help: remove the `mut` prefix: `Self`
+   |
+   = note: `mut` may be followed by `variable` and `variable @ pattern`
 
 error: expected identifier, found keyword `Self`
   --> $DIR/self_type_keyword.rs:19:17