]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/floating_point_powi.fixed
Rollup merge of #78769 - est31:remove_lifetimes, r=KodrAus
[rust.git] / src / tools / clippy / tests / ui / floating_point_powi.fixed
1 // run-rustfix
2 #![warn(clippy::suboptimal_flops)]
3
4 fn main() {
5     let one = 1;
6     let x = 3f32;
7     let _ = x * x;
8     let _ = x * x;
9
10     let y = 4f32;
11     let _ = x.mul_add(x, y);
12     let _ = y.mul_add(y, x);
13     let _ = x.mul_add(x, y).sqrt();
14     let _ = y.mul_add(y, x).sqrt();
15     // Cases where the lint shouldn't be applied
16     let _ = x.powi(3);
17     let _ = x.powi(one + 1);
18     let _ = (x.powi(2) + y.powi(2)).sqrt();
19 }