Description
This is a tracking issue for the prototype described in rust-lang/rust-project-goals#100. Background reading as to the design/justification for this feature.
The feature gate for the issue is #![feature(min_generic_const_args)]
.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Add
ConstArgKind::Path
(Represent type-level consts with new-and-improvedhir::ConstArg
#125915) - Use
ConstArgKind::Path
for all single-segment paths (UseConstArgKind::Path
for all single-segment paths, not just params undermin_generic_const_args
#131081) - Use
ConstArgKind::Path
for all paths - Support "simple" exprs necessary for constructing
adt_const_params
types:- Struct construction exprs, e.g.
Some(N)
,Adt { field: N }
SupportConstArgKind::Path
s for const struct/variant constructors #132985 - Array exprs, e.g.
[M; N]
,[1, 2, N]
- Tuple exprs,
(10, N)
- Struct construction exprs, e.g.
- Make inherent associated constants behave correctly
- Implement type system normalization that makes use of
associated_const_equality
bounds - Merge
feature(associated_const_equality)
intomin_generic_const_args
- Traits are dyn compatible if all associated consts are type safe
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
TODO
Implementation history
- Initial document proposing the design/feature hackmd link
- Represent type-level consts with new-and-improved
hir::ConstArg
#125915 - Fix anon const def-creation when macros are involved #129137
- Use
ConstArgKind::Path
for all single-segment paths, not just params undermin_generic_const_args
#131081 - Encode MIR for const ctors in metadata and allow eval for them #134873
- mgca: Lower all const paths as
ConstArgKind::Path
#135186