]> git.lizzy.rs Git - rust.git/commitdiff
Add E0130 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 2 Jul 2015 18:27:12 +0000 (20:27 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 4 Jul 2015 16:27:54 +0000 (18:27 +0200)
src/librustc_typeck/diagnostics.rs

index 01f7db83adfa1013a0e90d6dcdab497ac1fc94f3..8e6f6a50fa58f5f78667f9947e090e0d2eaef599 100644 (file)
@@ -1378,8 +1378,8 @@ struct Foo {
 // identifiers
 ```
 
-Please verify you used the good type or change the type parameter identifier.
-Example:
+Please verify that a name clash hasn't been accidentally introduced, and rename
+the type parameter if so. Example:
 
 ```
 pub struct Foo<T=SomeType> {
@@ -1388,6 +1388,35 @@ pub struct Foo<T=SomeType> {
 ```
 "##,
 
+E0130: r##"
+You declared a pattern as an argument in a foreign function declaration.
+Erroneous code example:
+
+```
+extern {
+    fn foo((a, b): (u32, u32)); // error: patterns aren't allowed in foreign
+                                //        function declarations
+}
+```
+
+Please replace the pattern argument with a regular one. Example:
+
+```
+struct SomeStruct {
+    a: u32,
+    b: u32,
+}
+
+extern {
+    fn foo(s: SomeStruct); // ok!
+}
+// or
+extern {
+    fn foo(a: (u32, u32)); // 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 `()`.
@@ -1999,7 +2028,6 @@ impl Baz for Bar { } // Note: This is OK
     E0123,
     E0127,
     E0129,
-    E0130,
     E0141,
     E0159,
     E0163,