| error: casts from `bool` to `u8` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:7:13 |
| | |
| LL | let _ = true as u8; |
| | ^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| = note: `-D clippy::cast-lossless` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]` |
| help: use `u8::from` instead |
| | |
| LL - let _ = true as u8; |
| LL + let _ = u8::from(true); |
| | |
| |
| error: casts from `bool` to `u16` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:9:13 |
| | |
| LL | let _ = true as u16; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u16::from` instead |
| | |
| LL - let _ = true as u16; |
| LL + let _ = u16::from(true); |
| | |
| |
| error: casts from `bool` to `u32` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:11:13 |
| | |
| LL | let _ = true as u32; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u32::from` instead |
| | |
| LL - let _ = true as u32; |
| LL + let _ = u32::from(true); |
| | |
| |
| error: casts from `bool` to `u64` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:13:13 |
| | |
| LL | let _ = true as u64; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u64::from` instead |
| | |
| LL - let _ = true as u64; |
| LL + let _ = u64::from(true); |
| | |
| |
| error: casts from `bool` to `u128` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:15:13 |
| | |
| LL | let _ = true as u128; |
| | ^^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u128::from` instead |
| | |
| LL - let _ = true as u128; |
| LL + let _ = u128::from(true); |
| | |
| |
| error: casts from `bool` to `usize` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:17:13 |
| | |
| LL | let _ = true as usize; |
| | ^^^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `usize::from` instead |
| | |
| LL - let _ = true as usize; |
| LL + let _ = usize::from(true); |
| | |
| |
| error: casts from `bool` to `i8` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:20:13 |
| | |
| LL | let _ = true as i8; |
| | ^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `i8::from` instead |
| | |
| LL - let _ = true as i8; |
| LL + let _ = i8::from(true); |
| | |
| |
| error: casts from `bool` to `i16` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:22:13 |
| | |
| LL | let _ = true as i16; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `i16::from` instead |
| | |
| LL - let _ = true as i16; |
| LL + let _ = i16::from(true); |
| | |
| |
| error: casts from `bool` to `i32` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:24:13 |
| | |
| LL | let _ = true as i32; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `i32::from` instead |
| | |
| LL - let _ = true as i32; |
| LL + let _ = i32::from(true); |
| | |
| |
| error: casts from `bool` to `i64` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:26:13 |
| | |
| LL | let _ = true as i64; |
| | ^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `i64::from` instead |
| | |
| LL - let _ = true as i64; |
| LL + let _ = i64::from(true); |
| | |
| |
| error: casts from `bool` to `i128` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:28:13 |
| | |
| LL | let _ = true as i128; |
| | ^^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `i128::from` instead |
| | |
| LL - let _ = true as i128; |
| LL + let _ = i128::from(true); |
| | |
| |
| error: casts from `bool` to `isize` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:30:13 |
| | |
| LL | let _ = true as isize; |
| | ^^^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `isize::from` instead |
| | |
| LL - let _ = true as isize; |
| LL + let _ = isize::from(true); |
| | |
| |
| error: casts from `bool` to `u16` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:34:13 |
| | |
| LL | let _ = (true | false) as u16; |
| | ^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u16::from` instead |
| | |
| LL - let _ = (true | false) as u16; |
| LL + let _ = u16::from(true | false); |
| | |
| |
| error: casts from `bool` to `u8` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:37:13 |
| | |
| LL | let _ = true as U8; |
| | ^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `U8::from` instead |
| | |
| LL - let _ = true as U8; |
| LL + let _ = U8::from(true); |
| | |
| |
| error: casts from `bool` to `u8` can be expressed infallibly using `From` |
| --> tests/ui/cast_lossless_bool.rs:66:13 |
| | |
| LL | let _ = true as u8; |
| | ^^^^^^^^^^ |
| | |
| = help: an `as` cast can become silently lossy if the types change in the future |
| help: use `u8::from` instead |
| | |
| LL - let _ = true as u8; |
| LL + let _ = u8::from(true); |
| | |
| |
| error: aborting due to 15 previous errors |
| |