Commit 664ab45
authored
Rollup merge of rust-lang#42597 - mark-buer:park_timeout_example_fix, r=alexcrichton
Capture elapsed duration in Thread::park_timeout example
`beginning_park.elapsed()` might return a larger value within the loop as compared to that checked in the loop conditional.
Since `Duration` arithmetic is checked, hitting such an edge case will cause a panic.1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | | - | |
791 | 790 | | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
796 | 800 | | |
797 | 801 | | |
798 | 802 | | |
| |||
0 commit comments