From e0bd01167e86d07c03e8ddd2bb0a25f689a2a7f5 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Sun, 8 Sep 2024 01:49:25 -0400 Subject: 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). --- compiler/rustc_middle/src/ty/consts.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index a5952c65692..6708ae60562 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -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 { -- cgit 1.4.1-3-g733a5