]> git.lizzy.rs Git - rust.git/commitdiff
Add E0124 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 1 Jul 2015 11:07:29 +0000 (13:07 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 1 Jul 2015 11:07:29 +0000 (13:07 +0200)
src/librustc_typeck/diagnostics.rs

index 05ddfe89bcf5c7786e44e9537ccdf856ba88afec..e95145c3760e6765dde69a684847b30a3eee1fd3 100644 (file)
@@ -1347,6 +1347,27 @@ fn foo() -> _ { 5 } // error, explicitly write out the return type instead
 ```
 "##,
 
+E0124: r##"
+You declared two fields of a struct with the same name. Erroneous code
+example:
+
+```
+struct Foo {
+    field1: i32,
+    field1: i32 // error: field is already declared
+}
+```
+
+Please check you didn't mispelled one field. Example:
+
+```
+struct Foo {
+    field1: i32,
+    field2: i32 // ok!
+}
+```
+"##,
+
 E0131: r##"
 It is not possible to define `main` with type parameters, or even with function
 parameters. When `main` is present, it must take no arguments and return `()`.
@@ -1956,7 +1977,6 @@ impl Baz for Bar { } // Note: This is OK
     E0120,
     E0122,
     E0123,
-    E0124,
     E0127,
     E0128,
     E0129,