Replace mk_const with Const::new_x methods
This commit is contained in:
@@ -377,7 +377,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
||||
// any equated inference vars correctly!
|
||||
let root_vid = self.infcx.root_const_var(vid);
|
||||
if root_vid != vid {
|
||||
c = self.infcx.tcx.mk_const(ty::InferConst::Var(root_vid), c.ty());
|
||||
c = ty::Const::new_var(self.infcx.tcx, root_vid, c.ty());
|
||||
vid = root_vid;
|
||||
}
|
||||
|
||||
@@ -426,6 +426,6 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
||||
var
|
||||
}),
|
||||
);
|
||||
self.interner().mk_const(ty::ConstKind::Bound(self.binder_index, var), c.ty())
|
||||
ty::Const::new_bound(self.infcx.tcx, self.binder_index, var, c.ty())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ impl<'tcx> NormalizationFolder<'_, 'tcx> {
|
||||
let recursion_limit = tcx.recursion_limit();
|
||||
if !recursion_limit.value_within_limit(self.depth) {
|
||||
self.at.infcx.err_ctxt().report_overflow_error(
|
||||
&tcx.mk_const(uv, ty),
|
||||
&ty::Const::new_unevaluated(tcx, uv, ty),
|
||||
self.at.cause.span,
|
||||
true,
|
||||
|_| {},
|
||||
@@ -131,7 +131,7 @@ impl<'tcx> NormalizationFolder<'_, 'tcx> {
|
||||
let ct = infcx.resolve_vars_if_possible(new_infer_ct);
|
||||
ct.try_fold_with(self)?
|
||||
} else {
|
||||
tcx.mk_const(uv, ty).try_super_fold_with(self)?
|
||||
ty::Const::new_unevaluated(tcx, uv, ty).try_super_fold_with(self)?
|
||||
};
|
||||
|
||||
self.depth -= 1;
|
||||
|
||||
Reference in New Issue
Block a user