@@ -129,26 +129,26 @@ Incremental compilation is re-enabled for the 1.60 release. The Rust team contin
129
129
On all platforms ` Instant ` will try to use an OS API that guarantees monotonic
130
130
behavior if available (which is the case on all tier 1 platforms). In practice
131
131
such 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
135
135
instead. ` Instant::checked_duration_since ` can be used to detect and handle
136
136
situations where monotonicity is violated, or ` Instant ` s are subtracted in the
137
137
wrong order.
138
138
139
139
This workaround obscures programming errors where earlier and later instants are
140
140
accidentally 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 .
142
142
143
143
Prior to 1.60, the monotonicity guarantees were provided through mutexes or
144
144
atomics in std, which can introduce large performance overheads to
145
145
` Instant::now() ` . Additionally, the panicking behavior meant that Rust software
146
146
could 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,
148
148
hardware, 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
150
150
portable, 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.
152
152
153
153
### Stabilized APIs
154
154
0 commit comments