Skip to content

Commit 238a15d

Browse files
author
Nick Hamann
committed
---
yaml --- r: 216742 b: refs/heads/stable c: 11a7bad h: refs/heads/master v: v3
1 parent 37af4d0 commit 238a15d

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 11cb5e50ab0fb166372d3aab68a06d5c06fdf2eb
32+
refs/heads/stable: 11a7bad97b79014aa145af11c6537843cb086b78
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/src/librustc_typeck/diagnostics.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ methods that do not have default implementations), as well as any required
1919
trait items like associated types or constants.
2020
"##,
2121

22+
E0054: r##"
23+
It is not allowed to cast to a bool. If you are trying to cast a numeric type
24+
to a bool, you can compare it with zero instead:
25+
26+
```
27+
let x = 5;
28+
29+
// Ok
30+
let x_is_nonzero = x != 0;
31+
32+
// Not allowed, won't compile
33+
let x_is_nonzero = x as bool;
34+
```
35+
"##,
36+
2237
E0081: r##"
2338
Enum discriminants are used to differentiate enum variants stored in memory.
2439
This error indicates that the same value was used for two or more variants,
@@ -116,7 +131,6 @@ register_diagnostics! {
116131
E0049,
117132
E0050,
118133
E0053,
119-
E0054,
120134
E0055,
121135
E0057,
122136
E0059,

0 commit comments

Comments
 (0)