From 2537abf503e1ac44a3b97fab6190ac4dff01a8ff Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 Jul 2015 12:24:12 +0200 Subject: [PATCH] Add E0431 error explanation --- src/librustc_resolve/diagnostics.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 8762c82015eb..a737a5ebe65d 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