diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2021-12-14 11:27:41 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-12-14 11:27:41 -0500 |
| commit | 4d1d66b812efe27cc460921fcc6b24622444800d (patch) | |
| tree | 30d407a899cac03eba3061f7ed09f6b070d603cb | |
| parent | 404c8471aba60c2d837fa728e7c729a0f52d5830 (diff) | |
| download | rust-4d1d66b812efe27cc460921fcc6b24622444800d.tar.gz rust-4d1d66b812efe27cc460921fcc6b24622444800d.zip | |
Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`
This avoids a needless query invocation
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 2 |
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, |
