Skip to content

Commit 6ae31b6

Browse files
Add examples in E0412
1 parent 028aba3 commit 6ae31b6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,29 @@ impl Bar {
398398
"##,
399399

400400
E0412: r##"
401-
An undeclared type name was used. Example of erroneous code:
401+
An undeclared type name was used. Example of erroneous codes:
402402
403403
```
404404
impl Something {} // error: use of undeclared type name `Something`
405+
// or:
406+
trait Foo {
407+
fn bar(N); // error: use of undeclared type name `N`
408+
}
405409
```
406410
407411
To fix this error, please verify you didn't misspell the type name or
408-
you did declare it. Example:
412+
you did declare it. Examples:
409413
410414
```
411415
struct Something;
412416
413417
impl Something {}
418+
// or:
419+
trait Foo {
420+
type N;
421+
422+
fn bar(Self::N);
423+
}
414424
```
415425
"##,
416426

0 commit comments

Comments
 (0)