rustc_hir_analysis: Remove premature classification of repeats as AnonConstKind::MCG by InvalidPathException · Pull Request #148852 · rust-lang/rust (original) (raw)
Thanks for looking into this, unfortunately I don't think this is quite the right fix. Under feature(min_generic_const_args) we'd like to stop treating repeat expression counts specially (ie we would like to treat them the same as normal MCG const arguments).
Your change currently causes us to go back to treating repeat expression counts specially. I think the desired fix would be to update name resolution to not treat repeat expression counts specially if feature(min_generic_const_args) is enabled. You can find the code for that here: https://github.com/rust-lang/rust/blob/main/compiler/rustc_resolve/src/late.rs#L4836-L4887
@rustbot author
Separately from this I do think the current logic of anon_const_kind is a bit confusing. It certainly seems like we've accidentally put the branch in the wrong place 🤔 Could you update the repeat expression count condition to explicitly check !tcx.features().min_generic_const_args() and add a comment stating that we don't want to treat repeat expression counts specially under mgca?