about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_typeck/diagnostics.rs34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 01f7db83adf..8e6f6a50fa5 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -1378,8 +1378,8 @@ pub struct Foo<SomeType=SomeType>;
 // 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 @@ register_diagnostics! {
     E0123,
     E0127,
     E0129,
-    E0130,
     E0141,
     E0159,
     E0163,