Skip to content

Commit 99796a6

Browse files
Update E0423 example
1 parent 378aba4 commit 99796a6

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ trait Foo {
408408
}
409409
```
410410
411-
To fix this error, please verify you didn't misspell the type name or
412-
you did declare it. Examples:
411+
To fix this error, please verify you didn't misspell the type name,
412+
you did declare it or imported it into the scope. Examples:
413413
414414
```
415415
struct Something;
@@ -436,8 +436,8 @@ let Foo = 12i32; // error: declaration of `Foo` shadows an enum variant or
436436
```
437437
438438
439-
To fix this error, you have to change the name of the declaration of the
440-
shadowed object. Please also verify that neither name was misspelled.
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.
441441
Example:
442442
443443
```
@@ -458,7 +458,7 @@ The goal here is to avoid a conflict of names.
458458
"##,
459459

460460
E0415: r##"
461-
More than one parameter have the same name. Example of erroneous
461+
More than one function parameter have the same name. Example of erroneous
462462
code:
463463
464464
```
@@ -532,8 +532,8 @@ match 0 {
532532
}
533533
```
534534
535-
Please verify you didn't misspell it or the enum variant, struct
536-
or const was well declared and/or imported. Example:
535+
Please verify you didn't misspell it and the enum variant, struct or const has
536+
been declared and imported into scope. Example:
537537
538538
```
539539
enum Something {
@@ -555,7 +555,7 @@ erroneous code:
555555
```
556556
struct Foo { a: bool};
557557
558-
println!("I am {}", Foo);
558+
let f = Foo();
559559
// error: `Foo` is a struct variant name, but this expression uses
560560
// it like a function name
561561
```
@@ -564,10 +564,9 @@ Please verify you didn't misspell the name of what you actually wanted
564564
to use here. Example:
565565
566566
```
567-
struct Foo { a: bool};
567+
fn Foo() -> u32 { 0 }
568568
569-
let foo = Foo { a: true };
570-
println!("I am {}", foo); // ok!
569+
let f = Foo(); // ok!
571570
```
572571
"##,
573572

@@ -729,15 +728,16 @@ Please verify you didn't misspell the import's name.
729728
"##,
730729

731730
E0435: r##"
732-
A non-constant value was used in a const. Example of erroneous code:
731+
A non-constant value was used to initialise a constant. Example of erroneous
732+
code:
733733
734734
```
735735
let foo = 42u32;
736736
const FOO : u32 = foo; // error: attempt to use a non-constant value in a
737737
// constant
738738
```
739739
740-
To fix this error, please replace the value by a constant one. Example:
740+
To fix this error, please replace the value with a constant. Example:
741741
742742
```
743743
const FOO : u32 = 42u32; // ok!

src/librustc_typeck/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,8 @@ fn main() {
11191119
"##,
11201120

11211121
E0102: r##"
1122-
You hit this error because the compiler the compiler lacks information
1123-
to determine a type for this variable. Erroneous code example:
1122+
You hit this error because the compiler lacks information to
1123+
determine a type for this variable. Erroneous code example:
11241124
11251125
```
11261126
fn main() {

0 commit comments

Comments
 (0)