Skip to content

Conversation

@InvalidPathException
Copy link
Contributor

Fixes #148822
Tracking issue: #132980

Root cause:

} else if tcx.features().min_generic_const_args() {
ty::AnonConstKind::MCGConst
} else if let hir::Node::Expr(hir::Expr {
kind: hir::ExprKind::Repeat(_, repeat_count),
..
}) = tcx.hir_node(tcx.parent_hir_id(const_arg_id))
&& repeat_count.hir_id == const_arg_id
{
ty::AnonConstKind::RepeatExprCount
} else {
ty::AnonConstKind::MCGConst
}

L1840 causes const args to be identified prematurely when the feature is enabled. for repeat array this is problematic because the next else-if at 1842 will not be hit (but it should be).

Fix:
Removed L1840 else-if block, it seems redundant if we move below the L1842 one, but it might have other responsibilities later on?

Testing:
Regression test from the issue.

r? @BoxyUwU

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 12, 2025

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: cannot find M/#0 in param-env with feature(min_generic_const_args)

3 participants