rust-clippy/tests/ui/cast_lossless_float.fixed
2019-01-08 21:46:39 +01:00

17 lines
395 B
Text

// run-rustfix
#[warn(clippy::cast_lossless)]
#[allow(clippy::no_effect, clippy::unnecessary_operation)]
fn main() {
// Test clippy::cast_lossless with casts to floating-point types
f32::from(1i8);
f64::from(1i8);
f32::from(1u8);
f64::from(1u8);
f32::from(1i16);
f64::from(1i16);
f32::from(1u16);
f64::from(1u16);
f64::from(1i32);
f64::from(1u32);
}