Un-unsafe the StableOrd trait

Whilst incorrect implementations of this trait can cause miscompilation,
they cannot cause memory unsafety in rustc.
This commit is contained in:
Alan Egerton
2024-06-12 13:01:22 +01:00
parent 02c7a5921e
commit 114dd2061e
6 changed files with 26 additions and 25 deletions

View File

@@ -425,10 +425,10 @@ pub struct Size {
raw: u64,
}
// Safety: Ord is implement as just comparing numerical values and numerical values
// Ord is implement as just comparing numerical values and numerical values
// are not changed by (de-)serialization.
#[cfg(feature = "nightly")]
unsafe impl StableOrd for Size {
impl StableOrd for Size {
const CAN_USE_UNSTABLE_SORT: bool = true;
}