Repository navigation
Tracking Issue for min_const_generics #74878
Copy link
Copy link
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Milestone
Description
This is a tracking issue for the minimal usable subset of RFC 2000 (rust-lang/rfcs#2000).
The feature gate for the issue is #![feature(min_const_generics)].
See rust-lang/lang-team#37 for more details.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses 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.
Steps
- Fix
const-generics-blockingissues. - Fix
const-generics-bad-diagnosticsissues. - Add many more
min_const_genericstests. - const wf (generic params in associated consts)
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Completed:
- should we keep allowing things like
[u8; std::mem::size_of::<*mut T>()]here (cc makeConstEvaluatablemore strict #74595) - how to deal with
ConstKind::Unevaluatedand incorrect inference cycles (cc fix unification of const variables #74040)
Implementation history
- based of Tracking issue for const generics (RFC 2000) #44580
- split into a separate feature gate in Implement the
min_const_genericsfeature gate #74877
Reacted by Alex Kladov, est31, therocode, im-nefilim, Andrew Chin, Darek, Matthieu Le brazidec (r3v2d0g), Colin, Stephen M. Coakley, BuggStream and 38 more
Reacted by belief
Reacted by belief and Denis Kotlyarov
Reacted by Gurwinder Singh, Lu, Wangshan, Charles Lew, llebout, Steve Klabnik, Darek, Michael Watzko, Nico Burns, James Munns, Alex Kladov and 38 more
Reacted by belief
Reacted by Gurwinder Singh, llebout, Steve Klabnik, Darek, James Munns, Alex Kladov, est31, Sebastian Dröge, James Waples, dpc and 18 more
Reacted by Gurwinder Singh, DutchGhost, Darek, James Munns, Alex Kladov, runiq, Sebastian Malton, Alex Gaynor, belief, Félix Fischer and 6 more
Reacted by belief, therocode and Jake Taylor
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Activity
[-]Tracking Issue for `min_const_generics[/-][+]Tracking Issue for `min_const_generics`[/+]alex commentedon Aug 13, 2020
👋 I'm trying to understand the limitations of
min_const_generics. Is it expected that https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=59cca2f3891e9fa921afdcbcda9f2588 compiles ok withoutmin_const_generics, but fails with it?lcnr commentedon Aug 13, 2020
😐
min_const_genericsshould not cause breaking changes, that's a bug. Opened #75486We will most probably write a more detailed summary of what will be allowed with this feature in the near future, for now I can recommend the post by @withoutboats about this: https://without.boats/blog/shipping-const-generics/
In general, please note that a tracking issue is not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter.
Feel free to ping @lcnr (me) when opening a new issue concerning this feature.
bstrie commentedon Sep 13, 2020
Regarding some of the steps listed here:
min_const_genericsfeature gate #74877 specifically calls out thatconst ASSOC: usize = 64 / N;should work, so is this step about discussing whether or not it should be stabilized, or is it calling out something that hasn't been implemented yet? Can someone with more background open an issue that we can link to?ConstEvaluatablemore strict #74595 is merged?varkor commentedon Sep 13, 2020
I'm going to go through and triage the issues for
F-min_const_genericssoon, so we can get a better picture of what's remaining.varkor commentedon Oct 1, 2020
I've added several labels, and come up with a system to help us track what remains. It's slightly complicated, because we need to track three versions of Rust essentially: nightly,
#![feature(min_const_generics)], and#![feature(const_generics)], which can all behave differently.const-generics-blockingtracks any bug or non-diagnostics issue that is important enough that it ought to block stabilisation ofmin_const_generics(we can later reuse this label forconst_generics).const-generics-bad-diagnosticstracks issues where we emit unhelpful diagnostics that make const generics more difficult to use. I think these should be addressed before stabilisation ofmin_const_generics(at least where they make sense formin_const_generics).const-generics-fixed-by-min_const_genericsis a bug that occurs with or without aconst_genericsfeature flag, which behaves correctly after enablingmin_const_generics.const-generics-fixed-by-const_genericsis a bug that is fixed by enablingconst_generics.If an issue is marked with
const-generics-fixed-by-min_const_genericsandE-needs-test, we need to add a test for it under#[feature(min_const_generics)]. After adding the test, we can removeE-needs-test. If the test already works on nightly, then we can also removeconst-generics-fixed-by-min_const_generics.If an issue is marked with
const-generics-fixed-by-const_genericsandE-needs-test, we need to add a test for it under#[feature(const_generics)]. After adding the test, we can removeE-needs-test.In summary, after addressing
E-needs-test, if the issue still occurs on nightly or under#![feature(const_generics)], don't close the issue.I'll try to deal with the current
E-needs-testissues now, so no-one has to deal with my overly complicated labelling system immediately.varkor commentedon Oct 2, 2020
Regarding the remaining steps: there are only a handful of issues I think are blocking
min_const_genericsat this stage (several of which already have open pull requests). We also want to add many more tests, which is something anyone can easily help with. If you want to tackle one of the issues, feel free to ask @lcnr or myself how to get started; I'm going to dedicate time to fixing whichever remain.I'm not sure if anything remains to be done with the WF bullet point: perhaps @lcnr could clarify?
2 remaining items
jacobchrismarsh commentedon Oct 13, 2020
@lcnr and @varkor, I'd love to help out on this. Where can I start?
varkor commentedon Oct 21, 2020
@jacobchrismarsh: thanks for offering (and sorry for taking so long to reply: it's been really busy on my end recently)! We seem to be wrapping up
F-min_const_genericsat the moment (all the existing issues have open PRs), so the last big thing remaining is improving the test suite coverage for the feature. We're going to plan out what kind of things we need to have tests for, and we can let you know when that's ready: we'd be eager to have help writing tests.If you're keen to fix some bugs now, there are still a number of (non-
min_)const_genericsissues left. I think most of the bugs will require a little bit of investigation to fix, but there are still a few easier ones. Some examples are #75763, #65349 (for which there's an old PR you could revive and fix up), and #61414. But feel free to take a look at any of the issues and comment there, and I'll try to give you pointers on how to get started!est31 commentedon Nov 4, 2020
Re the test coverage point, there is a tracking issue now for it: #78433
mark-i-m commentedon Nov 13, 2020
#78433 is now complete 🎉
ices/69239.rs: fixed with errors
Auto merge of rust-lang#79135 - lcnr:the-paleogenesis-of-generic-germ…
alex commentedon Dec 28, 2020
This is now stable on the latest nightly.
joshtriplett commentedon Jan 19, 2021
We discussed this in the @rust-lang/lang meeting today, and we feel that this feature warrants a Rust blog post. Would one of the const-generics team members be up for writing that post?
lcnr commentedon Jan 19, 2021
yes, I still intend to write a post for when this feature hits beta.
Require rustc 1.51+ for `IndexMap::from(array)` and `IndexSet::from(a…
Require rustc 1.51+ for `IndexMap::from(array)` and `IndexSet::from(a…
Require rustc 1.51+ for `IndexMap::from(array)` and `IndexSet::from(a…