4 #![warn(clippy::cast_lossless)]
7 // Test clippy::cast_lossless with casts to integer types
13 let _ = true as usize;
20 let _ = true as isize;
22 // Test with an expression wrapped in parens
23 let _ = (true | false) as u16;
26 // The lint would suggest using `u32::from(input)` here but the `XX::from` function is not const,
27 // so we skip the lint if the expression is in a const fn.
29 const fn abc(input: bool) -> u32 {
33 // Same as the above issue. We can't suggest `::from` in const fns in impls
34 mod cast_lossless_in_impl {
38 pub const fn convert(x: bool) -> u64 {