From 4d1d66b812efe27cc460921fcc6b24622444800d Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 14 Dec 2021 11:27:41 -0500 Subject: [PATCH] Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp` This avoids a needless query invocation --- compiler/rustc_middle/src/ty/sty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index a80fe6a3362b4..1c525fb55e1b5 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -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,