Skip to content

Commit

Permalink
Stop passing a redundant key
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Nov 23, 2024
1 parent 1b30977 commit 4ece9e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ fn check_impl_items_against_trait<'tcx>(
continue;
};

tcx.ensure().compare_impl_item((impl_item.expect_local(), ty_trait_item.def_id));
let _ = tcx.ensure().compare_impl_item(impl_item.expect_local());

check_specialization_validity(
tcx,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ mod refine;
/// Call the query `tcx.compare_impl_item()` directly instead.
pub(super) fn compare_impl_item(
tcx: TyCtxt<'_>,
(impl_item_def_id, trait_item_def_id): (LocalDefId, DefId),
impl_item_def_id: LocalDefId,
) -> Result<(), ErrorGuaranteed> {
let impl_item = tcx.associated_item(impl_item_def_id);
let trait_item = tcx.associated_item(trait_item_def_id);
let trait_item = tcx.associated_item(impl_item.trait_item_def_id.unwrap());
let impl_trait_ref =
tcx.impl_trait_ref(impl_item.container_id(tcx)).unwrap().instantiate_identity();
debug!(?impl_trait_ref);
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2310,9 +2310,9 @@ rustc_queries! {
}

query compare_impl_item(
key: (LocalDefId, DefId)
key: LocalDefId
) -> Result<(), ErrorGuaranteed> {
desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key.0) }
desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key) }
cache_on_disk_if { true }
ensure_forwards_result_if_red
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ty_utils/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ fn resolve_associated_item<'tcx>(
if trait_item_id != leaf_def.item.def_id
&& let Some(leaf_def_item) = leaf_def.item.def_id.as_local()
{
tcx.ensure().compare_impl_item((leaf_def_item, trait_item_id))?;
tcx.ensure().compare_impl_item(leaf_def_item)?;
}

Some(ty::Instance::new(leaf_def.item.def_id, args))
Expand Down

0 comments on commit 4ece9e6

Please sign in to comment.