11error: manual implementation of `midpoint` which can overflow
2- --> tests/ui/manual_midpoint.rs:30 :13
2+ --> tests/ui/manual_midpoint.rs:31 :13
33 |
44LL | let _ = (a + 5) / 2;
55 | ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(a, 5)`
@@ -8,52 +8,58 @@ LL | let _ = (a + 5) / 2;
88 = help: to override `-D warnings` add `#[allow(clippy::manual_midpoint)]`
99
1010error: manual implementation of `midpoint` which can overflow
11- --> tests/ui/manual_midpoint.rs:33 :13
11+ --> tests/ui/manual_midpoint.rs:34 :13
1212 |
1313LL | let _ = (f + 5.0) / 2.0;
1414 | ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 5.0)`
1515
1616error: manual implementation of `midpoint` which can overflow
17- --> tests/ui/manual_midpoint.rs:35 :22
17+ --> tests/ui/manual_midpoint.rs:36 :22
1818 |
1919LL | let _: u32 = 5 + (8 + 8) / 2 + 2;
2020 | ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`
2121
2222error: manual implementation of `midpoint` which can overflow
23- --> tests/ui/manual_midpoint.rs:36 :26
23+ --> tests/ui/manual_midpoint.rs:37 :26
2424 |
2525LL | let _: u32 = const { (8 + 8) / 2 };
2626 | ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`
2727
2828error: manual implementation of `midpoint` which can overflow
29- --> tests/ui/manual_midpoint.rs:37 :26
29+ --> tests/ui/manual_midpoint.rs:38 :26
3030 |
3131LL | let _: f64 = const { (8.0f64 + 8.) / 2. };
3232 | ^^^^^^^^^^^^^^^^^^ help: use `f64::midpoint` instead: `f64::midpoint(8.0f64, 8.)`
3333
3434error: manual implementation of `midpoint` which can overflow
35- --> tests/ui/manual_midpoint.rs:38 :18
35+ --> tests/ui/manual_midpoint.rs:39 :18
3636 |
3737LL | let _: u32 = (u32::default() + u32::default()) / 2;
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(u32::default(), u32::default())`
3939
4040error: manual implementation of `midpoint` which can overflow
41- --> tests/ui/manual_midpoint.rs:39 :18
41+ --> tests/ui/manual_midpoint.rs:40 :18
4242 |
4343LL | let _: u32 = (two!() + two!()) / 2;
4444 | ^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(two!(), two!())`
4545
4646error: manual implementation of `midpoint` which can overflow
47- --> tests/ui/manual_midpoint.rs:61 :13
47+ --> tests/ui/manual_midpoint.rs:62 :13
4848 |
4949LL | let _ = (f + 1.0) / 2.0;
5050 | ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 1.0)`
5151
5252error: manual implementation of `midpoint` which can overflow
53- --> tests/ui/manual_midpoint.rs:62 :13
53+ --> tests/ui/manual_midpoint.rs:63 :13
5454 |
5555LL | let _ = (1.0 + f) / 2.0;
5656 | ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(1.0, f)`
5757
58- error: aborting due to 9 previous errors
58+ error: manual implementation of `midpoint` which can overflow
59+ --> tests/ui/manual_midpoint.rs:74:13
60+ |
61+ LL | let _ = (i + 10) / 2;
62+ | ^^^^^^^^^^^^ help: use `i32::midpoint` instead: `i32::midpoint(i, 10)`
63+
64+ error: aborting due to 10 previous errors
5965
0 commit comments