fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
487 B19 linesraw
1#![warn(clippy::imprecise_flops)]
2#![allow(clippy::unnecessary_cast)]
3
4fn main() {
5    let x = 2f32;
6    let _ = x.exp_m1();
7    let _ = x.exp_m1() + 2.0;
8    let _ = (x as f32).exp_m1() + 2.0;
9    // Cases where the lint shouldn't be applied
10    let _ = x.exp() - 2.0;
11    let _ = x.exp() - 1.0 * 2.0;
12
13    let x = 2f64;
14    let _ = x.exp_m1();
15    let _ = x.exp_m1() + 2.0;
16    // Cases where the lint shouldn't be applied
17    let _ = x.exp() - 2.0;
18    let _ = x.exp() - 1.0 * 2.0;
19}