Skip to content

Commit c864fe9

Browse files
author
Nick Hamann
committed
---
yaml --- r: 206551 b: refs/heads/beta c: 11a7bad h: refs/heads/master i: 206549: 362690e 206547: 5a07a82 206543: e551812 v: v3
1 parent 26a4028 commit c864fe9

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,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 11cb5e50ab0fb166372d3aab68a06d5c06fdf2eb
32+
refs/heads/beta: 11a7bad97b79014aa145af11c6537843cb086b78
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 579e31929feff51dcaf8d444648eff8de735f91a

branches/beta/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)