summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_infer/src/infer/generalize.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_infer/src/infer/generalize.rs')
-rw-r--r--compiler/rustc_infer/src/infer/generalize.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_infer/src/infer/generalize.rs b/compiler/rustc_infer/src/infer/generalize.rs
index d4a1dacde..780250167 100644
--- a/compiler/rustc_infer/src/infer/generalize.rs
+++ b/compiler/rustc_infer/src/infer/generalize.rs
@@ -277,7 +277,7 @@ where
let origin = *inner.type_variables().var_origin(vid);
let new_var_id =
inner.type_variables().new_var(self.for_universe, origin);
- let u = self.tcx().mk_ty_var(new_var_id);
+ let u = Ty::new_var(self.tcx(), new_var_id);
// Record that we replaced `vid` with `new_var_id` as part of a generalization
// operation. This is needed to detect cyclic types. To see why, see the
@@ -398,7 +398,7 @@ where
origin: var_value.origin,
val: ConstVariableValue::Unknown { universe: self.for_universe },
});
- Ok(self.tcx().mk_const(new_var_id, c.ty()))
+ Ok(ty::Const::new_var(self.tcx(), new_var_id, c.ty()))
}
}
}
@@ -412,7 +412,11 @@ where
substs,
substs,
)?;
- Ok(self.tcx().mk_const(ty::UnevaluatedConst { def, substs }, c.ty()))
+ Ok(ty::Const::new_unevaluated(
+ self.tcx(),
+ ty::UnevaluatedConst { def, substs },
+ c.ty(),
+ ))
}
ty::ConstKind::Placeholder(placeholder) => {
if self.for_universe.can_name(placeholder.universe) {