about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_midpoint.stderr
blob: 3d588e2114df3d014f02e212c8666e6044e2994e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:30:13
   |
LL |     let _ = (a + 5) / 2;
   |             ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(a, 5)`
   |
   = note: `-D clippy::manual-midpoint` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_midpoint)]`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:33:13
   |
LL |     let _ = (f + 5.0) / 2.0;
   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 5.0)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:35:22
   |
LL |     let _: u32 = 5 + (8 + 8) / 2 + 2;
   |                      ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:36:26
   |
LL |     let _: u32 = const { (8 + 8) / 2 };
   |                          ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:37:26
   |
LL |     let _: f64 = const { (8.0f64 + 8.) / 2. };
   |                          ^^^^^^^^^^^^^^^^^^ help: use `f64::midpoint` instead: `f64::midpoint(8.0f64, 8.)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:38:18
   |
LL |     let _: u32 = (u32::default() + u32::default()) / 2;
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(u32::default(), u32::default())`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:39:18
   |
LL |     let _: u32 = (two!() + two!()) / 2;
   |                  ^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(two!(), two!())`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:61:13
   |
LL |     let _ = (f + 1.0) / 2.0;
   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 1.0)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:62:13
   |
LL |     let _ = (1.0 + f) / 2.0;
   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(1.0, f)`

error: manual implementation of `midpoint` which can overflow
  --> tests/ui/manual_midpoint.rs:73:13
   |
LL |     let _ = (i + 10) / 2;
   |             ^^^^^^^^^^^^ help: use `i32::midpoint` instead: `i32::midpoint(i, 10)`

error: aborting due to 10 previous errors