rust/src/libstd/sys
bors ca94c75c52 Auto merge of #44220 - kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton
Properly detect overflow in Instance ± Duration.

Fix #44216.
Fix #42622

The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic.

The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second.

Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.
2017-09-10 18:37:27 +00:00
..
redox Properly detect overflow in Instance +/- Duration. 2017-09-07 17:14:27 +08:00
unix Auto merge of #44220 - kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton 2017-09-10 18:37:27 +00:00
windows Properly detect overflow in Instance +/- Duration. 2017-09-07 17:14:27 +08:00
mod.rs Exposed all platform-specific documentation. 2017-08-10 13:43:59 +08:00