fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.3 KiB29 linesraw
1error: unchecked subtraction of a 'Duration' from an 'Instant'
2  --> $DIR/unchecked_duration_subtraction.rs:9:13
3   |
4LL |     let _ = _first - second;
5   |             ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
6   |
7   = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::unchecked_duration_subtraction)]`
9
10error: unchecked subtraction of a 'Duration' from an 'Instant'
11  --> $DIR/unchecked_duration_subtraction.rs:11:13
12   |
13LL |     let _ = Instant::now() - Duration::from_secs(5);
14   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`
15
16error: unchecked subtraction of a 'Duration' from an 'Instant'
17  --> $DIR/unchecked_duration_subtraction.rs:13:13
18   |
19LL |     let _ = _first - Duration::from_secs(5);
20   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`
21
22error: unchecked subtraction of a 'Duration' from an 'Instant'
23  --> $DIR/unchecked_duration_subtraction.rs:15:13
24   |
25LL |     let _ = Instant::now() - second;
26   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
27
28error: aborting due to 4 previous errors
29