mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 08:30:45 +00:00
12 lines
249 B
Rust
12 lines
249 B
Rust
#![warn(clippy::integer_division)]
|
|
|
|
fn main() {
|
|
let two = 2;
|
|
let n = 1 / 2;
|
|
//~^ ERROR: integer division
|
|
let o = 1 / two;
|
|
//~^ ERROR: integer division
|
|
let p = two / 4;
|
|
//~^ ERROR: integer division
|
|
let x = 1. / 2.0;
|
|
}
|