IdentitySubsts::identity_for_item takes Into<DefId>

This commit is contained in:
Michael Goulet
2023-03-13 19:35:29 +00:00
parent 979ef5981f
commit 7e6506764b
14 changed files with 27 additions and 28 deletions

View File

@@ -211,7 +211,7 @@ fn check_opaque(tcx: TyCtxt<'_>, id: hir::ItemId) {
return;
}
let substs = InternalSubsts::identity_for_item(tcx, item.owner_id.to_def_id());
let substs = InternalSubsts::identity_for_item(tcx, item.owner_id);
let span = tcx.def_span(item.owner_id.def_id);
if !tcx.features().impl_trait_projections {
@@ -304,7 +304,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
..
}) = item.kind
{
let substs = InternalSubsts::identity_for_item(tcx, def_id.to_def_id());
let substs = InternalSubsts::identity_for_item(tcx, def_id);
let opaque_identity_ty = if in_trait {
tcx.mk_projection(def_id.to_def_id(), substs)
} else {
@@ -535,7 +535,7 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) {
}
ty::AssocKind::Type if assoc_item.defaultness(tcx).has_value() => {
let trait_substs =
InternalSubsts::identity_for_item(tcx, id.owner_id.to_def_id());
InternalSubsts::identity_for_item(tcx, id.owner_id);
let _: Result<_, rustc_errors::ErrorGuaranteed> = check_type_bounds(
tcx,
assoc_item,