mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 17:28:07 +00:00
eb3970285b
In order to switch `clippy::uninlined_format_args` from pedantic to style, all existing tests must not raise a warning. I did not want to change the actual tests, so this is a relatively minor change that: * add `#![allow(clippy::uninlined_format_args)]` where needed * normalizes all allow/deny/warn attributes * all allow attributes are grouped together * sorted alphabetically * the `clippy::*` attributes are listed separate from the other ones. * deny and warn attributes are listed before the allowed ones changelog: none
32 lines
906 B
Rust
32 lines
906 B
Rust
// run-rustfix
|
|
#![warn(clippy::cast_abs_to_unsigned)]
|
|
#![allow(clippy::uninlined_format_args)]
|
|
|
|
fn main() {
|
|
let x: i32 = -42;
|
|
let y: u32 = x.unsigned_abs();
|
|
println!("The absolute value of {} is {}", x, y);
|
|
|
|
let a: i32 = -3;
|
|
let _: usize = a.unsigned_abs() as usize;
|
|
let _: usize = a.unsigned_abs() as _;
|
|
let _ = a.unsigned_abs() as usize;
|
|
|
|
let a: i64 = -3;
|
|
let _ = a.unsigned_abs() as usize;
|
|
let _ = a.unsigned_abs() as u8;
|
|
let _ = a.unsigned_abs() as u16;
|
|
let _ = a.unsigned_abs() as u32;
|
|
let _ = a.unsigned_abs();
|
|
let _ = a.unsigned_abs() as u128;
|
|
|
|
let a: isize = -3;
|
|
let _ = a.unsigned_abs();
|
|
let _ = a.unsigned_abs() as u8;
|
|
let _ = a.unsigned_abs() as u16;
|
|
let _ = a.unsigned_abs() as u32;
|
|
let _ = a.unsigned_abs() as u64;
|
|
let _ = a.unsigned_abs() as u128;
|
|
|
|
let _ = (x as i64 - y as i64).unsigned_abs() as u32;
|
|
}
|