Skip to content

Commit d2e6dda

Browse files
Add E0124 error explanation
1 parent a9e26b5 commit d2e6dda

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,27 @@ static BAR: _ = "test"; // error, explicitly write out the type instead
13471347
```
13481348
"##,
13491349

1350+
E0124: r##"
1351+
You declared two fields of a struct with the same name. Erroneous code
1352+
example:
1353+
1354+
```
1355+
struct Foo {
1356+
field1: i32,
1357+
field1: i32 // error: field is already declared
1358+
}
1359+
```
1360+
1361+
Please check you didn't mispelled one field. Example:
1362+
1363+
```
1364+
struct Foo {
1365+
field1: i32,
1366+
field2: i32 // ok!
1367+
}
1368+
```
1369+
"##,
1370+
13501371
E0131: r##"
13511372
It is not possible to define `main` with type parameters, or even with function
13521373
parameters. When `main` is present, it must take no arguments and return `()`.
@@ -1956,7 +1977,6 @@ register_diagnostics! {
19561977
E0120,
19571978
E0122,
19581979
E0123,
1959-
E0124,
19601980
E0127,
19611981
E0128,
19621982
E0129,

0 commit comments

Comments
 (0)