Clean up E0054
This commit is contained in:
parent
1a3c8c8964
commit
041c9f6f48
@ -1,5 +1,6 @@
|
||||
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:
|
||||
It is not allowed to cast to a bool.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0054
|
||||
let x = 5;
|
||||
@ -8,6 +9,9 @@ let x = 5;
|
||||
let x_is_nonzero = x as bool;
|
||||
```
|
||||
|
||||
If you are trying to cast a numeric type to a bool, you can compare it with
|
||||
zero instead:
|
||||
|
||||
```
|
||||
let x = 5;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user