Skip to content

Commit

Permalink
Use tcx.def_path_hash in ExistentialPredicate.stable_cmp
Browse files Browse the repository at this point in the history
This avoids a needless query invocation
  • Loading branch information
Aaron1011 committed Dec 14, 2021
1 parent 404c847 commit 4d1d66b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4d1d66b

Please sign in to comment.