1
Fork 0

Re-enable ConstArgKind::Path lowering by default

...and remove the `const_arg_path` feature gate as a result. It was only
a stopgap measure to fix the regression that the new lowering introduced
(which should now be fixed by this PR).
This commit is contained in:
Noah Lev 2024-09-08 01:49:25 -04:00
parent 8b75004bca
commit e0bd01167e
34 changed files with 69 additions and 203 deletions

View file

@ -295,20 +295,12 @@ impl<'tcx> Const<'tcx> {
_ => expr,
};
if let hir::ExprKind::Path(
qpath @ hir::QPath::Resolved(
_,
&hir::Path { res: Res::Def(DefKind::ConstParam, _), .. },
),
) = expr.kind
if let hir::ExprKind::Path(hir::QPath::Resolved(
_,
&hir::Path { res: Res::Def(DefKind::ConstParam, _), .. },
)) = expr.kind
{
if tcx.features().const_arg_path {
span_bug!(
expr.span,
"try_from_lit: received const param which shouldn't be possible"
);
}
return Some(Const::from_param(tcx, qpath, expr.hir_id));
span_bug!(expr.span, "try_from_lit: received const param which shouldn't be possible");
};
let lit_input = match expr.kind {