2019-06-11 11:53:12 -05:00
|
|
|
#![warn(clippy::integer_division)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let two = 2;
|
|
|
|
let n = 1 / 2;
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: integer division
|
2019-06-11 11:53:12 -05:00
|
|
|
let o = 1 / two;
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: integer division
|
2019-06-11 11:53:12 -05:00
|
|
|
let p = two / 4;
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: integer division
|
2019-06-11 11:53:12 -05:00
|
|
|
let x = 1. / 2.0;
|
|
|
|
}
|