Remove PartialOrd/Ord impl for PlaceRef

This is a new attempt at #93315. It removes one usage
of the `Ord` impl for `DefId`, which should make it easier
to eventually remove that impl.
This commit is contained in:
Aaron Hill 2022-05-09 22:48:43 -04:00
parent 08b4f1be33
commit 6b747aa397
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 15 additions and 5 deletions

View file

@ -2084,12 +2084,18 @@ rustc_index::newtype_index! {
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct PlaceRef<'tcx> {
pub local: Local,
pub projection: &'tcx [PlaceElem<'tcx>],
}
// Once we stop implementing `Ord` for `DefId`,
// this impl will be unnecessary. Until then, we'll
// leave this impl in place to prevent re-adding a
// dependnecy on the `Ord` impl for `DefId`
impl<'tcx> !PartialOrd for PlaceRef<'tcx> {}
impl<'tcx> Place<'tcx> {
// FIXME change this to a const fn by also making List::empty a const fn.
pub fn return_place() -> Place<'tcx> {