]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unnecessary_cast_fixable.rs
Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / unnecessary_cast_fixable.rs
1 // run-rustfix
2
3 #![warn(clippy::unnecessary_cast)]
4 #![allow(clippy::no_effect, clippy::unnecessary_operation)]
5
6 fn main() {
7     // casting integer literal to float is unnecessary
8     100 as f32;
9     100 as f64;
10     100_i32 as f64;
11     // Should not trigger
12     #[rustfmt::skip]
13     let v = vec!(1);
14     &v as &[i32];
15     1.0 as f64;
16     1 as u64;
17     0x10 as f32;
18     0o10 as f32;
19     0b10 as f32;
20     0x11 as f64;
21     0o11 as f64;
22     0b11 as f64;
23 }