about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorThe8472 <git@infinite-source.de>2021-10-15 23:55:23 +0200
committerThe 8472 <git@infinite-source.de>2022-02-13 01:04:55 +0100
commit9d8ef1160747a4d033f21803770641f2deb32b25 (patch)
tree4e6f7872651d83ab3cfc0470e0bd3cb68a628bce /src/test/codegen/src-hash-algorithm
parent5d8767cb229b097fedb1dd4bd9420d463c37774f (diff)
downloadrust-9d8ef1160747a4d033f21803770641f2deb32b25.tar.gz
rust-9d8ef1160747a4d033f21803770641f2deb32b25.zip
make Instant::{duration_since, elapsed, sub} saturating and remove workarounds
This removes all mutex/atomics based workarounds for non-monotonic clocks and makes the previously panicking methods saturating instead.

Effectively this moves the monotonization from `Instant` construction to the comparisons.

This has some observable effects, especially on platforms without monotonic clocks:

* Incorrectly ordered Instant comparisons no longer panic. This may hide some programming errors until someone actually looks at the resulting `Duration`
* `checked_duration_since` will now return `None` in more cases. Previously it only happened when one compared instants obtained in the wrong order or
  manually created ones. Now it also does on backslides.

The upside is reduced complexity and lower overhead of `Instant::now`.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions