]> git.lizzy.rs Git - rust.git/blob - src/test/ui/cast/cast-as-bool.stderr
Rollup merge of #97066 - petrochenkov:nofragkind, r=camelid
[rust.git] / src / test / ui / cast / cast-as-bool.stderr
1 error[E0054]: cannot cast as `bool`
2   --> $DIR/cast-as-bool.rs:2:13
3    |
4 LL |     let u = 5 as bool;
5    |             ^^^^^^^^^ help: compare with zero instead: `5 != 0`
6
7 error[E0054]: cannot cast as `bool`
8   --> $DIR/cast-as-bool.rs:5:13
9    |
10 LL |     let t = (1 + 2) as bool;
11    |             ^^^^^^^^^^^^^^^ help: compare with zero instead: `(1 + 2) != 0`
12
13 error[E0606]: casting `&'static str` as `bool` is invalid
14   --> $DIR/cast-as-bool.rs:8:13
15    |
16 LL |     let v = "hello" as bool;
17    |             ^^^^^^^^^^^^^^^
18
19 error: aborting due to 3 previous errors
20
21 Some errors have detailed explanations: E0054, E0606.
22 For more information about an error, try `rustc --explain E0054`.