diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index a929a9215b3c7..08c01a4af95f4 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -1577,8 +1577,6 @@ fn anon_const_kind<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> ty::AnonConstKin let parent_hir_node = tcx.hir_node(tcx.parent_hir_id(const_arg_id)); if tcx.features().generic_const_exprs() { ty::AnonConstKind::GCE - } else if tcx.features().min_generic_const_args() { - ty::AnonConstKind::MCG } else if let hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Repeat(_, repeat_count), .. diff --git a/tests/ui/const-generics/mgca/repeat-self-const.rs b/tests/ui/const-generics/mgca/repeat-self-const.rs new file mode 100644 index 0000000000000..56ff20a12ffc0 --- /dev/null +++ b/tests/ui/const-generics/mgca/repeat-self-const.rs @@ -0,0 +1,17 @@ +//@ check-pass +#![expect(incomplete_features)] +#![feature(min_generic_const_args)] + +struct S(); + +impl S { + const N: usize = M; + + fn f() { + let arr = [0; Self::N + 1]; + } +} + +fn main() { + S::<3>::f(); +}