Skip to content

Commit 4ece9e6

Browse files
Stop passing a redundant key
1 parent 1b30977 commit 4ece9e6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ fn check_impl_items_against_trait<'tcx>(
10371037
continue;
10381038
};
10391039

1040-
tcx.ensure().compare_impl_item((impl_item.expect_local(), ty_trait_item.def_id));
1040+
let _ = tcx.ensure().compare_impl_item(impl_item.expect_local());
10411041

10421042
check_specialization_validity(
10431043
tcx,

Diff for: compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ mod refine;
3838
/// Call the query `tcx.compare_impl_item()` directly instead.
3939
pub(super) fn compare_impl_item(
4040
tcx: TyCtxt<'_>,
41-
(impl_item_def_id, trait_item_def_id): (LocalDefId, DefId),
41+
impl_item_def_id: LocalDefId,
4242
) -> Result<(), ErrorGuaranteed> {
4343
let impl_item = tcx.associated_item(impl_item_def_id);
44-
let trait_item = tcx.associated_item(trait_item_def_id);
44+
let trait_item = tcx.associated_item(impl_item.trait_item_def_id.unwrap());
4545
let impl_trait_ref =
4646
tcx.impl_trait_ref(impl_item.container_id(tcx)).unwrap().instantiate_identity();
4747
debug!(?impl_trait_ref);

Diff for: compiler/rustc_middle/src/query/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2310,9 +2310,9 @@ rustc_queries! {
23102310
}
23112311

23122312
query compare_impl_item(
2313-
key: (LocalDefId, DefId)
2313+
key: LocalDefId
23142314
) -> Result<(), ErrorGuaranteed> {
2315-
desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key.0) }
2315+
desc { |tcx| "checking assoc item `{}` is compatible with trait definition", tcx.def_path_str(key) }
23162316
cache_on_disk_if { true }
23172317
ensure_forwards_result_if_red
23182318
}

Diff for: compiler/rustc_ty_utils/src/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn resolve_associated_item<'tcx>(
217217
if trait_item_id != leaf_def.item.def_id
218218
&& let Some(leaf_def_item) = leaf_def.item.def_id.as_local()
219219
{
220-
tcx.ensure().compare_impl_item((leaf_def_item, trait_item_id))?;
220+
tcx.ensure().compare_impl_item(leaf_def_item)?;
221221
}
222222

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

0 commit comments

Comments
 (0)