| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:9:13 |
| | |
| LL | let _ = _first - second; |
| | ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()` |
| | |
| = note: `-D clippy::unchecked-time-subtraction` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::unchecked_time_subtraction)]` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_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` |
| --> tests/ui/unchecked_time_subtraction.rs:15:13 |
| | |
| LL | let _ = _first - Duration::from_secs(5); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:18:13 |
| | |
| LL | let _ = Instant::now() - second; |
| | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:25:13 |
| | |
| LL | let _ = dur1 - dur2; |
| | ^^^^^^^^^^^ help: try: `dur1.checked_sub(dur2).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:30:13 |
| | |
| LL | let _ = second - dur1; |
| | ^^^^^^^^^^^^^ help: try: `second.checked_sub(dur1).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:34:13 |
| | |
| LL | let _ = 2 * dur1 - dur2; |
| | ^^^^^^^^^^^^^^^ help: try: `(2 * dur1).checked_sub(dur2).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:41:5 |
| | |
| LL | Duration::ZERO.sub(Duration::MAX); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Duration::ZERO.checked_sub(Duration::MAX).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:44:13 |
| | |
| LL | let _ = Duration::ZERO - Duration::MAX; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Duration::ZERO.checked_sub(Duration::MAX).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:58:5 |
| | |
| LL | d.sub(duration!(1)); |
| | ^^^^^^^^^^^^^^^^^^^ help: try: `d.checked_sub(duration!(1)).unwrap()` |
| |
| error: unchecked subtraction of a `Duration` |
| --> tests/ui/unchecked_time_subtraction.rs:60:13 |
| | |
| LL | let _ = d - duration!(1); |
| | ^^^^^^^^^^^^^^^^ help: try: `d.checked_sub(duration!(1)).unwrap()` |
| |
| error: aborting due to 11 previous errors |
| |