]> git.lizzy.rs Git - rust.git/blob - tests/ui/unchecked_duration_subtraction.stderr
Auto merge of #9745 - matttpt:fix-redundant-closure-for-method-calls-suggestion,...
[rust.git] / tests / ui / unchecked_duration_subtraction.stderr
1 error: unchecked subtraction of a 'Duration' from an 'Instant'
2   --> $DIR/unchecked_duration_subtraction.rs:10:13
3    |
4 LL |     let _ = _first - second;
5    |             ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
6    |
7    = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
8
9 error: unchecked subtraction of a 'Duration' from an 'Instant'
10   --> $DIR/unchecked_duration_subtraction.rs:12:13
11    |
12 LL |     let _ = Instant::now() - Duration::from_secs(5);
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`
14
15 error: unchecked subtraction of a 'Duration' from an 'Instant'
16   --> $DIR/unchecked_duration_subtraction.rs:14:13
17    |
18 LL |     let _ = _first - Duration::from_secs(5);
19    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`
20
21 error: unchecked subtraction of a 'Duration' from an 'Instant'
22   --> $DIR/unchecked_duration_subtraction.rs:16:13
23    |
24 LL |     let _ = Instant::now() - second;
25    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
26
27 error: aborting due to 4 previous errors
28