Auto merge of #105012 - WaffleLapkin:into, r=oli-obk

Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`)

r? `@oli-obk` you've asked for this >:)
This commit is contained in:
bors 2022-11-29 13:28:44 +00:00
commit e0098a5cc3
20 changed files with 86 additions and 98 deletions

View file

@ -799,9 +799,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
unevaluated,
Some(obligation.cause.span),
) {
Ok(Some(valtree)) => {
Ok(ty::Const::from_value(selcx.tcx(), valtree, c.ty()))
}
Ok(Some(valtree)) => Ok(selcx.tcx().mk_const(valtree, c.ty())),
Ok(None) => {
let tcx = self.tcx;
let def_id = unevaluated.def.did;

View file

@ -818,7 +818,7 @@ impl<'tcx> TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> {
let universe = self.universe_for(debruijn);
let p = ty::PlaceholderConst { universe, name: bound_const };
self.mapped_consts.insert(p, bound_const);
self.infcx.tcx.mk_const(ty::ConstKind::Placeholder(p), ct.ty())
self.infcx.tcx.mk_const(p, ct.ty())
}
_ => ct.super_fold_with(self),
}