Use tcx.def_path_hash in ExistentialPredicate.stable_cmp

This avoids a needless query invocation
This commit is contained in:
Aaron Hill 2021-12-14 11:27:41 -05:00
parent 404c8471ab
commit 4d1d66b812
No known key found for this signature in database
GPG Key ID: B4087E510E98B164

View File

@ -787,7 +787,7 @@ impl<'tcx> ExistentialPredicate<'tcx> {
tcx.def_path_hash(a.item_def_id).cmp(&tcx.def_path_hash(b.item_def_id))
}
(AutoTrait(ref a), AutoTrait(ref b)) => {
tcx.trait_def(*a).def_path_hash.cmp(&tcx.trait_def(*b).def_path_hash)
tcx.def_path_hash(*a).cmp(&tcx.def_path_hash(*b))
}
(Trait(_), _) => Ordering::Less,
(Projection(_), Trait(_)) => Ordering::Greater,