rust/src/test/ui/cast/cast-as-bool.stderr

22 lines
724 B
Plaintext
Raw Normal View History

error[E0054]: cannot cast as `bool`
2018-12-25 09:56:47 -06:00
--> $DIR/cast-as-bool.rs:2:13
|
LL | let u = 5 as bool; //~ ERROR cannot cast as `bool`
| ^^^^^^^^^ help: compare with zero instead: `5 != 0`
error[E0054]: cannot cast as `bool`
--> $DIR/cast-as-bool.rs:5:13
|
LL | let t = (1 + 2) as bool; //~ ERROR cannot cast as `bool`
| ^^^^^^^^^^^^^^^ help: compare with zero instead: `(1 + 2) != 0`
error[E0054]: cannot cast as `bool`
--> $DIR/cast-as-bool.rs:8:13
|
LL | let v = "hello" as bool; //~ ERROR cannot cast as `bool`
| ^^^^^^^^^^^^^^^ unsupported cast
error: aborting due to 3 previous errors
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0054`.