2022-11-21 13:34:47 -06:00
|
|
|
error: unchecked subtraction of a 'Duration' from an 'Instant'
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unchecked_duration_subtraction.rs:9:13
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
LL | let _ = _first - second;
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unchecked_duration_subtraction)]`
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
error: unchecked subtraction of a 'Duration' from an 'Instant'
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unchecked_duration_subtraction.rs:11:13
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
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'
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unchecked_duration_subtraction.rs:13:13
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
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'
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unchecked_duration_subtraction.rs:15:13
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Instant::now() - second;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|