mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
17 lines
395 B
Text
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);
|
|
}
|