1
Fork 0

Refactor tcx mk_const parameters.

This commit is contained in:
Mateusz 2022-11-04 20:33:32 +00:00
parent 6330c27ae2
commit c97fd8183a
No known key found for this signature in database
GPG key ID: 386CB5E415137469
21 changed files with 74 additions and 104 deletions

View file

@ -734,10 +734,10 @@ fn bound_vars_for_item<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> SubstsRef<'tcx
}
ty::GenericParamDefKind::Const { .. } => tcx
.mk_const(ty::ConstS {
kind: ty::ConstKind::Bound(ty::INNERMOST, ty::BoundVar::from(param.index)),
ty: tcx.type_of(param.def_id),
})
.mk_const(
ty::ConstKind::Bound(ty::INNERMOST, ty::BoundVar::from(param.index)),
tcx.type_of(param.def_id),
)
.into(),
})
}

View file

@ -546,7 +546,7 @@ impl<'tcx> LowerInto<'tcx, ty::Const<'tcx>> for &chalk_ir::Const<RustInterner<'t
chalk_ir::ConstValue::Placeholder(_p) => unimplemented!(),
chalk_ir::ConstValue::Concrete(c) => ty::ConstKind::Value(c.interned),
};
interner.tcx.mk_const(ty::ConstS { ty, kind })
interner.tcx.mk_const(kind, ty)
}
}