From 2a08cff97c94160ddd06cdec380bbde8bd4f1d1b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 6 Aug 2015 20:47:10 +0200 Subject: [PATCH] Add another example for E0412 --- src/librustc_resolve/diagnostics.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index b814af979dec..5fe1e2869173 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -406,6 +406,8 @@ impl Something {} // error: use of undeclared type name `Something` trait Foo { fn bar(N); // error: use of undeclared type name `N` } +// or: +fn foo(x: T) {} // error: use of undeclared type name `T` ``` To fix this error, please verify you didn't misspell the type name, @@ -414,13 +416,15 @@ you did declare it or imported it into the scope. Examples: ``` struct Something; -impl Something {} +impl Something {} // ok! // or: trait Foo { type N; - fn bar(Self::N); + fn bar(Self::N); // ok! } +//or: +fn foo(x: T) {} // ok! ``` "##, @@ -436,9 +440,8 @@ let Foo = 12i32; // error: declaration of `Foo` shadows an enum variant or ``` -To fix this error, make sure declarations do not shadow any enum variants or -structures in the scope. Please also verify that neither name was misspelled. -Example: +To fix this error, rename the variable such that it doesn't shadow any enum +variable or structure in scope. Example: ``` struct Foo;