Closed
Description
This is a tracking issue for the RFC "Constants in array repeat expressions" (rust-lang/rfcs#2203) (feature gate: const_in_array_repeat_expressions
).
Steps:
- Implement the RFC (cc @rust-lang/compiler -- can anyone write up mentoring instructions?)
- Adjust documentation (see instructions on forge)
- Stabilization PR (see instructions on forge)
Implementation history:
- Initial implementation: rustc/rustc_mir: Implement RFC 2203. #61749
- (this is incomplete)
Unresolved questions:
- Should we treat this as an explicit promotion context? That would allow calling arbitrary
const fn
, but poses the risk of breaking code that would otherwise work fine if we decide to promote when it would not have been necessary. The alternative is to rely on inline const expressions instead (Tracking Issue for inline const patterns (RFC 2920) #76001). - Should we maybe not perform any promotion at all, and instead require a named const, literal, or explicit
const {}
block for the repeat expression?
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Area: const generics (parameters and arguments)Blocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the language team