about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-07-24 12:24:12 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-07-24 12:24:12 +0200
commit2537abf503e1ac44a3b97fab6190ac4dff01a8ff (patch)
tree4b3a30a87e3ec079b3b329276693e8af3b17b4bf
parent18f4e8ce5eabd77c872b5429b9a0172f0d446c9e (diff)
Add E0431 error explanation
-rw-r--r--src/librustc_resolve/diagnostics.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs
index 8762c82015e..a737a5ebe65 100644
--- a/src/librustc_resolve/diagnostics.rs
+++ b/src/librustc_resolve/diagnostics.rs
@@ -476,7 +476,7 @@ struct Bar2; // ok!
 "##,
 
 E0430: r##"
-The `self` import appears more than once in the list.
+The `self` import appears more than once in the list. Erroneous code example:
 
 ```
 use something::{self, self}; // error: `self` import can only appear once in
@@ -487,6 +487,18 @@ Please verify you didn't misspell the import name or remove the duplicated
 `self` import.
 "##,
 
+E0431: r##"
+`self` import was made. Erroneous code example:
+
+```
+use {self}; // error: `self` import can only appear in an import list with a
+            //        non-empty prefix
+```
+
+You can't import the current module in itself, please remove this import or
+verify you didn't misspell it.
+"##,
+
 E0433: r##"
 Invalid import. Example of erroneous code:
 
@@ -531,8 +543,6 @@ register_diagnostics! {
     E0426, // use of undeclared label
     E0427, // cannot use `ref` binding mode with ...
     E0429, // `self` imports are only allowed within a { } list
-    E0431, // `self` import can only appear in an import list with a non-empty
-           // prefix
     E0432, // unresolved import
     E0434, // can't capture dynamic environment in a fn item
     E0435, // attempt to use a non-constant value in a constant