@@ -2,27 +2,27 @@ error: unchecked subtraction of a 'Duration' from an 'Instant'
22 --> $DIR/unchecked_duration_subtraction.rs:10:13
33 |
44LL | let _ = _first - second;
5- | ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap(); `
5+ | ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
66 |
77 = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
88
99error: unchecked subtraction of a 'Duration' from an 'Instant'
1010 --> $DIR/unchecked_duration_subtraction.rs:12:13
1111 |
1212LL | let _ = Instant::now() - Duration::from_secs(5);
13- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap(); `
13+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`
1414
1515error: unchecked subtraction of a 'Duration' from an 'Instant'
1616 --> $DIR/unchecked_duration_subtraction.rs:14:13
1717 |
1818LL | let _ = _first - Duration::from_secs(5);
19- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap(); `
19+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`
2020
2121error: unchecked subtraction of a 'Duration' from an 'Instant'
2222 --> $DIR/unchecked_duration_subtraction.rs:16:13
2323 |
2424LL | let _ = Instant::now() - second;
25- | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap(); `
25+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
2626
2727error: aborting due to 4 previous errors
2828
0 commit comments