From 05fcb2e9bc679d689a92122f4803977c83b878aa Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 2 Jul 2015 20:27:12 +0200 Subject: [PATCH] Add E0130 error explanation --- src/librustc_typeck/diagnostics.rs | 34 +++++++++++++++++++++++++++--- 1 file 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; // 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 { @@ -1388,6 +1388,35 @@ pub struct Foo { ``` "##, +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,