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

@ -2525,7 +2525,7 @@ impl<'tcx> ConstantKind<'tcx> {
let parent_substs = if let Some(parent_hir_id) = tcx.hir().opt_parent_id(hir_id)
&& let Some(parent_did) = parent_hir_id.as_owner()
{
InternalSubsts::identity_for_item(tcx, parent_did.to_def_id())
InternalSubsts::identity_for_item(tcx, parent_did)
} else {
List::empty()
};
@ -2554,7 +2554,7 @@ impl<'tcx> ConstantKind<'tcx> {
Self::Unevaluated(
UnevaluatedConst {
def: def.to_global(),
substs: InternalSubsts::identity_for_item(tcx, def.did.to_def_id()),
substs: InternalSubsts::identity_for_item(tcx, def.did),
promoted: None,
},
ty,