@@ -129,26 +129,26 @@ Incremental compilation is re-enabled for the 1.60 release. The Rust team contin
129129On all platforms ` Instant ` will try to use an OS API that guarantees monotonic
130130behavior if available (which is the case on all tier 1 platforms). In practice
131131such guarantees are -- under rare circumstances -- broken by hardware,
132- virtualization or operating system bugs. To work around these bugs and platforms
133- not offering monotonic clocks ` Instant::duration_since ` , ` Instant::elapsed ` and
134- ` Instant::sub ` saturate to zero. In older Rust versions this lead to a panic
132+ virtualization, or operating system bugs. To work around these bugs and platforms
133+ not offering monotonic clocks, ` Instant::duration_since ` , ` Instant::elapsed ` and
134+ ` Instant::sub ` now saturate to zero. In older Rust versions this led to a panic
135135instead. ` Instant::checked_duration_since ` can be used to detect and handle
136136situations where monotonicity is violated, or ` Instant ` s are subtracted in the
137137wrong order.
138138
139139This workaround obscures programming errors where earlier and later instants are
140140accidentally swapped. For this reason future Rust versions may reintroduce
141- panics in at least those cases.
141+ panics in at least those cases, if possible and efficient .
142142
143143Prior to 1.60, the monotonicity guarantees were provided through mutexes or
144144atomics in std, which can introduce large performance overheads to
145145` Instant::now() ` . Additionally, the panicking behavior meant that Rust software
146146could panic in a subset of environments, which was largely undesirable, as the
147- authors of that software may not be in a place to upgrade the operating system,
147+ authors of that software may not be able to fix or upgrade the operating system,
148148hardware, or virtualization system they are running on. Further, introducing
149- unexpected panics into these environments make Rust software less reliable and
149+ unexpected panics into these environments made Rust software less reliable and
150150portable, which is of higher concern than exposing typically uninteresting
151- platform bugs to end users.
151+ platform bugs in monotonic clock handling to end users.
152152
153153### Stabilized APIs
154154
0 commit comments