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

@@ -120,8 +120,8 @@ impl Default for DefPathHash {
}
}
// Safety: `DefPathHash` sort order is not affected (de)serialization.
unsafe impl StableOrd for DefPathHash {
// `DefPathHash` sort order is not affected (de)serialization.
impl StableOrd for DefPathHash {
const CAN_USE_UNSTABLE_SORT: bool = true;
}