Skip to content

Commit 2a08cff

Browse files
Add another example for E0412
1 parent 99796a6 commit 2a08cff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ impl Something {} // error: use of undeclared type name `Something`
406406
trait Foo {
407407
fn bar(N); // error: use of undeclared type name `N`
408408
}
409+
// or:
410+
fn foo(x: T) {} // error: use of undeclared type name `T`
409411
```
410412
411413
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:
414416
```
415417
struct Something;
416418
417-
impl Something {}
419+
impl Something {} // ok!
418420
// or:
419421
trait Foo {
420422
type N;
421423
422-
fn bar(Self::N);
424+
fn bar(Self::N); // ok!
423425
}
426+
//or:
427+
fn foo<T>(x: T) {} // ok!
424428
```
425429
"##,
426430

@@ -436,9 +440,8 @@ let Foo = 12i32; // error: declaration of `Foo` shadows an enum variant or
436440
```
437441
438442
439-
To fix this error, make sure declarations do not shadow any enum variants or
440-
structures in the scope. Please also verify that neither name was misspelled.
441-
Example:
443+
To fix this error, rename the variable such that it doesn't shadow any enum
444+
variable or structure in scope. Example:
442445
443446
```
444447
struct Foo;

0 commit comments

Comments
 (0)