about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_arithmetic_check.stderr
blob: b1598a5d06dc154bde57c06c80c678bfa20946a3 (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
error: manual arithmetic check found
  --> tests/ui/manual_arithmetic_check.rs:9:18
   |
LL |     let result = if a > b { a - b } else { 0 };
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b)`
   |
   = note: `-D clippy::implicit-saturating-sub` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_sub)]`

error: manual arithmetic check found
  --> tests/ui/manual_arithmetic_check.rs:12:18
   |
LL |     let result = if b < a { a - b } else { 0 };
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b)`

error: manual arithmetic check found
  --> tests/ui/manual_arithmetic_check.rs:15:18
   |
LL |     let result = if a < b { 0 } else { a - b };
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b)`

error: manual arithmetic check found
  --> tests/ui/manual_arithmetic_check.rs:18:18
   |
LL |     let result = if b > a { 0 } else { a - b };
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b)`

error: aborting due to 4 previous errors