diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-08-06 20:47:10 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-08-06 20:57:36 +0200 |
| commit | 2a08cff97c94160ddd06cdec380bbde8bd4f1d1b (patch) | |
| tree | ecd9a1bd94ef628cd6a41705877ccac07cb0339e /src | |
| parent | 99796a6c9c98f17c93384228396a8a808b46a1a0 (diff) | |
| download | rust-2a08cff97c94160ddd06cdec380bbde8bd4f1d1b.tar.gz rust-2a08cff97c94160ddd06cdec380bbde8bd4f1d1b.zip | |
Add another example for E0412
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_resolve/diagnostics.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index b814af979de..5fe1e286917 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<T>(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; |
