diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2024-09-08 01:49:25 -0400 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2024-09-12 13:56:01 -0400 |
| commit | e0bd01167e86d07c03e8ddd2bb0a25f689a2a7f5 (patch) | |
| tree | 199eece79e78d0a347adfdad064c8791f8e562ef /compiler/rustc_middle/src | |
| parent | 8b75004bcad5f25ef31894986945ff75b53d7d94 (diff) | |
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).
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/consts.rs | 18 |
1 files changed, 5 insertions, 13 deletions
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 { |
