Skip to content

Commit 5b2e5de

Browse files
Fix repeat anon const classification for min_generic_const_args
1 parent 25d319a commit 5b2e5de

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,6 @@ fn anon_const_kind<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> ty::AnonConstKin
15771577
let parent_hir_node = tcx.hir_node(tcx.parent_hir_id(const_arg_id));
15781578
if tcx.features().generic_const_exprs() {
15791579
ty::AnonConstKind::GCE
1580-
} else if tcx.features().min_generic_const_args() {
1581-
ty::AnonConstKind::MCG
15821580
} else if let hir::Node::Expr(hir::Expr {
15831581
kind: hir::ExprKind::Repeat(_, repeat_count),
15841582
..
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ check-pass
2+
#![expect(incomplete_features)]
3+
#![feature(min_generic_const_args)]
4+
5+
struct S<const M: usize>();
6+
7+
impl<const M: usize> S<M> {
8+
const N: usize = M;
9+
10+
fn f() {
11+
let arr = [0; Self::N + 1];
12+
}
13+
}
14+
15+
fn main() {
16+
S::<3>::f();
17+
}

0 commit comments

Comments
 (0)