]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/floating_point_hypot.fixed
Rollup merge of #78728 - a1phyr:const_cell_into_inner, r=dtolnay
[rust.git] / src / tools / clippy / tests / ui / floating_point_hypot.fixed
1 // run-rustfix
2 #![warn(clippy::imprecise_flops)]
3
4 fn main() {
5     let x = 3f32;
6     let y = 4f32;
7     let _ = x.hypot(y);
8     let _ = (x + 1f32).hypot(y);
9     let _ = x.hypot(y);
10     // Cases where the lint shouldn't be applied
11     // TODO: linting this adds some complexity, but could be done
12     let _ = x.mul_add(x, y * y).sqrt();
13     let _ = (x * 4f32 + y * y).sqrt();
14 }