2021-12-06 05:33:31 -06:00
|
|
|
error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:6:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as u8;
|
|
|
|
| ^^^^^^^^^^ help: try: `u8::from(true)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::cast-lossless` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:7:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as u16;
|
|
|
|
| ^^^^^^^^^^^ help: try: `u16::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `u32` is more cleanly stated with `u32::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:8:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as u32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `u32::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `u64` is more cleanly stated with `u64::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:9:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as u64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `u64::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `u128` is more cleanly stated with `u128::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:10:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as u128;
|
|
|
|
| ^^^^^^^^^^^^ help: try: `u128::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `usize` is more cleanly stated with `usize::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:11:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as usize;
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `usize::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `i8` is more cleanly stated with `i8::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:13:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as i8;
|
|
|
|
| ^^^^^^^^^^ help: try: `i8::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `i16` is more cleanly stated with `i16::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:14:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as i16;
|
|
|
|
| ^^^^^^^^^^^ help: try: `i16::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `i32` is more cleanly stated with `i32::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:15:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as i32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `i32::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `i64` is more cleanly stated with `i64::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:16:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as i64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `i64::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `i128` is more cleanly stated with `i128::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:17:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as i128;
|
|
|
|
| ^^^^^^^^^^^^ help: try: `i128::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `isize` is more cleanly stated with `isize::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:18:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = true as isize;
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `isize::from(true)`
|
|
|
|
|
|
|
|
error: casting `bool` to `u16` is more cleanly stated with `u16::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:21:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = (true | false) as u16;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::from(true | false)`
|
|
|
|
|
2022-10-23 08:18:45 -05:00
|
|
|
error: casting `bool` to `u8` is more cleanly stated with `u8::from(_)`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/cast_lossless_bool.rs:49:13
|
2022-10-23 08:18:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = true as u8;
|
|
|
|
| ^^^^^^^^^^ help: try: `u8::from(true)`
|
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
2021-12-06 05:33:31 -06:00
|
|
|
|