1
Fork 0

Remove Const::from_value

...it's just `mk_const` but without the sparcles
This commit is contained in:
Maybe Waffle 2022-11-28 12:38:15 +00:00
parent 26b87bf8ff
commit f4d00fe785
6 changed files with 9 additions and 19 deletions

View file

@ -125,11 +125,11 @@ fn recurse_build<'tcx>(
}
&ExprKind::NonHirLiteral { lit, user_ty: _ } => {
let val = ty::ValTree::from_scalar_int(lit);
ty::Const::from_value(tcx, val, node.ty)
tcx.mk_const(val, node.ty)
}
&ExprKind::ZstLiteral { user_ty: _ } => {
let val = ty::ValTree::zst();
ty::Const::from_value(tcx, val, node.ty)
tcx.mk_const(val, node.ty)
}
&ExprKind::NamedConst { def_id, substs, user_ty: _ } => {
let uneval = ty::UnevaluatedConst::new(ty::WithOptConstParam::unknown(def_id), substs);