From 11cb5e50ab0fb166372d3aab68a06d5c06fdf2eb Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Thu, 7 May 2015 13:08:59 -0500 Subject: [PATCH 1/2] Add long diagnostic for E0046 --- src/librustc_typeck/diagnostics.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 154d824e67846..c8b106db65e27 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -12,6 +12,13 @@ register_long_diagnostics! { +E0046: r##" +When trying to make some type implement a trait `Foo`, you must, at minimum, +provide implementations for all of `Foo`'s required methods (meaning the +methods that do not have default implementations), as well as any required +trait items like associated types or constants. +"##, + E0081: r##" Enum discriminants are used to differentiate enum variants stored in memory. This error indicates that the same value was used for two or more variants, @@ -106,7 +113,6 @@ register_diagnostics! { E0040, // explicit use of destructor method E0044, E0045, - E0046, E0049, E0050, E0053, From 11a7bad97b79014aa145af11c6537843cb086b78 Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Thu, 7 May 2015 14:34:54 -0500 Subject: [PATCH 2/2] Add long diagnostic for E0054 --- src/librustc_typeck/diagnostics.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index c8b106db65e27..f00f0eea1f48d 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -19,6 +19,21 @@ methods that do not have default implementations), as well as any required trait items like associated types or constants. "##, +E0054: r##" +It is not allowed to cast to a bool. If you are trying to cast a numeric type +to a bool, you can compare it with zero instead: + +``` +let x = 5; + +// Ok +let x_is_nonzero = x != 0; + +// Not allowed, won't compile +let x_is_nonzero = x as bool; +``` +"##, + E0081: r##" Enum discriminants are used to differentiate enum variants stored in memory. This error indicates that the same value was used for two or more variants, @@ -116,7 +131,6 @@ register_diagnostics! { E0049, E0050, E0053, - E0054, E0055, E0057, E0059,