We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a3c8c8 commit 041c9f6Copy full SHA for 041c9f6
src/librustc_error_codes/error_codes/E0054.md
@@ -1,5 +1,6 @@
1
-It is not allowed to cast to a bool. If you are trying to cast a numeric type
2
-to a bool, you can compare it with zero instead:
+It is not allowed to cast to a bool.
+
3
+Erroneous code example:
4
5
```compile_fail,E0054
6
let x = 5;
@@ -8,6 +9,9 @@ let x = 5;
8
9
let x_is_nonzero = x as bool;
10
```
11
12
+If you are trying to cast a numeric type to a bool, you can compare it with
13
+zero instead:
14
15
16
17
0 commit comments