From 347991540a53643cf2bec1acca30ee76d11e1b25 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 10 Aug 2015 15:29:06 +0200 Subject: [PATCH 1/2] Add another example for E0425 --- src/librustc_resolve/diagnostics.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 5c55fc53e023b..d3c393d7fd569 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -627,6 +627,9 @@ trait Foo { Self; // error: unresolved name `Self` } } + +// or: +let x = unknown_variable; // error: unresolved name `unknown_variable` ``` Please verify you didn't misspell the name or that you're not using an @@ -636,12 +639,17 @@ invalid object. Example: enum something_that_does_exist { foo } + // or: mod something_that_does_exist { pub static foo : i32 = 0i32; } something_that_does_exist::foo; // ok! + +// or: +let unknown_variable = 12u32; +let x = unknown_variable; // ok! ``` "##, From f1e613eeb10aea231911b5da1c01eca2805f0f49 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 11 Aug 2015 19:16:23 +0200 Subject: [PATCH 2/2] Update E0425 error explanation --- src/librustc_resolve/diagnostics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index d3c393d7fd569..3bac178b09b27 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -632,8 +632,8 @@ trait Foo { let x = unknown_variable; // error: unresolved name `unknown_variable` ``` -Please verify you didn't misspell the name or that you're not using an -invalid object. Example: +Please verify that the name wasn't misspelled and ensure that the +identifier being referred to is valid for the given situation. Example: ``` enum something_that_does_exist {