1
Fork 0

Rollup merge of #103984 - V0ldek:103974-refactor-mk_const, r=BoxyUwU

Refactor tcx mk_const parameters.

Unroll the `ty::ConstS` parameter to `TyCtxt::mk_const` into separate `ty::ConstKind` and `Ty` parameters.

Signature change is in:

c97fd8183a/compiler/rustc_middle/src/ty/context.rs (L2234)

and

c97fd8183a/compiler/rustc_middle/src/ty/context.rs (L2572-L2575)

the rest is callsites.

Closes #103974

r? `@oli-obk`
This commit is contained in:
Matthias Krüger 2022-11-05 00:02:06 +01:00 committed by GitHub
commit b101f3a865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 74 additions and 104 deletions

View file

@ -74,8 +74,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
Constant { user_ty, span, literal }
}
ExprKind::ConstParam { param, def_id: _ } => {
let const_param =
tcx.mk_const(ty::ConstS { kind: ty::ConstKind::Param(param), ty: expr.ty });
let const_param = tcx.mk_const(ty::ConstKind::Param(param), expr.ty);
let literal = ConstantKind::Ty(const_param);
Constant { user_ty: None, span, literal }