1
Fork 0

Use ConstArg for array lengths

This commit is contained in:
Noah Lev 2024-06-04 18:24:08 -07:00
parent 8818708a31
commit 67fccb7045
14 changed files with 77 additions and 45 deletions

View file

@ -2140,7 +2140,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
let length = match length {
hir::ArrayLen::Infer(inf) => self.ct_infer(None, inf.span),
hir::ArrayLen::Body(constant) => {
ty::Const::from_anon_const(tcx, constant.def_id)
ty::Const::from_const_arg(tcx, constant, ty::FeedConstTy::No)
}
};