diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-05-09 00:37:43 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-05-09 00:37:43 +0530 |
| commit | 638deb3bc38f92c0241966f3e4c3b75d4766b005 (patch) | |
| tree | acffbe5817f83c330b405fd68cd334032f710712 | |
| parent | b02270963c1678867d144f4621db86d606290ecb (diff) | |
| parent | 11a7bad97b79014aa145af11c6537843cb086b78 (diff) | |
| download | rust-638deb3bc38f92c0241966f3e4c3b75d4766b005.tar.gz rust-638deb3bc38f92c0241966f3e4c3b75d4766b005.zip | |
Rollup merge of #25190 - nham:E0046_E0054, r=alexcrichton
cc #24407
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 154d824e678..f00f0eea1f4 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -12,6 +12,28 @@ 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. +"##, + +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, @@ -106,11 +128,9 @@ register_diagnostics! { E0040, // explicit use of destructor method E0044, E0045, - E0046, E0049, E0050, E0053, - E0054, E0055, E0057, E0059, |
