]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs
Auto merge of #97168 - SparrowLii:accesses, r=cjgillot
[rust.git] / src / tools / clippy / tests / ui / cast_abs_to_unsigned.rs
1 // run-rustfix
2 #![warn(clippy::cast_abs_to_unsigned)]
3
4 fn main() {
5     let x: i32 = -42;
6     let y: u32 = x.abs() as u32;
7     println!("The absolute value of {} is {}", x, y);
8 }