summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/unchecked_duration_subtraction.stderr
blob: a2e0aa1d7c0892142e7ace042167613343619873 (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
error: unchecked subtraction of a 'Duration' from an 'Instant'
  --> $DIR/unchecked_duration_subtraction.rs:10:13
   |
LL |     let _ = _first - second;
   |             ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
   |
   = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`

error: unchecked subtraction of a 'Duration' from an 'Instant'
  --> $DIR/unchecked_duration_subtraction.rs:12:13
   |
LL |     let _ = Instant::now() - Duration::from_secs(5);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`

error: unchecked subtraction of a 'Duration' from an 'Instant'
  --> $DIR/unchecked_duration_subtraction.rs:14:13
   |
LL |     let _ = _first - Duration::from_secs(5);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`

error: unchecked subtraction of a 'Duration' from an 'Instant'
  --> $DIR/unchecked_duration_subtraction.rs:16:13
   |
LL |     let _ = Instant::now() - second;
   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`

error: aborting due to 4 previous errors