about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-15 10:57:04 +0100
committerGitHub <noreply@github.com>2021-12-15 10:57:04 +0100
commit990cf5bca455fe9082b29f24ffc409a182ab48bf (patch)
treefebcad66fa227e179da5a6bcf5c2d944f9e74ac6
parent13fb05107402f410a31c8652d3b754ee8ac64517 (diff)
parent4d1d66b812efe27cc460921fcc6b24622444800d (diff)
downloadrust-990cf5bca455fe9082b29f24ffc409a182ab48bf.tar.gz
rust-990cf5bca455fe9082b29f24ffc409a182ab48bf.zip
Rollup merge of #91920 - Aaron1011:pred-stable-cmp, r=oli-obk
Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`

This avoids a needless query invocation
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index a80fe6a3362..1c525fb55e1 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,