Refactor tcx mk_const parameters.

This commit is contained in:
Mateusz
2022-11-04 20:33:32 +00:00
parent 6330c27ae2
commit c97fd8183a
21 changed files with 74 additions and 104 deletions

View File

@@ -2414,10 +2414,8 @@ impl<'tcx> ConstantKind<'tcx> {
let generics = tcx.generics_of(item_def_id.to_def_id());
let index = generics.param_def_id_to_index[&def_id];
let name = tcx.hir().name(hir_id);
let ty_const = tcx.mk_const(ty::ConstS {
kind: ty::ConstKind::Param(ty::ParamConst::new(index, name)),
ty,
});
let ty_const =
tcx.mk_const(ty::ConstKind::Param(ty::ParamConst::new(index, name)), ty);
debug!(?ty_const);
return Self::Ty(ty_const);