From 5429c9be78a0d55424a65244b956ea50e79c1f1e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Jul 2015 14:45:24 +0200 Subject: [PATCH] Add E0423 error explanation --- src/librustc_resolve/diagnostics.rs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 5ddc2547fd9c..cd0da6a35d8c 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -425,6 +425,29 @@ match 0 { ``` "##, +E0424: r##" +A `struct` variant name was used like a function name. Example of +erroneous code: + +``` +struct Foo { a: bool}; + +println!("I am {}", Foo); +// error: `Foo` is a struct variant name, but this expression uses +// it like a function name +``` + +Please verify you didn't misspell the name of what you actually wanted +to use here. Example: + +``` +struct Foo { a: bool}; + +let foo = Foo { a: true }; +println!("I am {}", foo); // ok! +``` +"##, + E0424: r##" The `self` keyword was used in a static method. Example of erroneous code: @@ -660,8 +683,6 @@ register_diagnostics! { E0420, // is not an associated const E0421, // unresolved associated const E0422, // does not name a structure - E0423, // is a struct variant name, but this expression uses it like a - // function name E0427, // cannot use `ref` binding mode with ... E0429, // `self` imports are only allowed within a { } list E0434, // can't capture dynamic environment in a fn item