-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the min_const_generics
feature gate
#74877
Conversation
This comment has been minimized.
This comment has been minimized.
@rustbot modify labels: +A-const-generics |
r? @oli-obk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you got some submodule changes entangled in your PR
I think we should port all const_generics
tests that can be ported to min_const_generics
in order to have a good coverage of the behaviour that we're stabilizing. This may require splitting some tests into a min_const_generic
test and a const_generic
test.
I don't think it should block this PR, but I would like to see us doing a better write-up of what is permitted and not permitted in the "min const generics" variant, and why, and where the tests are. I imagine this is the work we'll be doing in the project group though. UPDATE: I realize there are a lot of write-ups already and I think other folks who are closer to what's going on have a clear picture. It's just that I feel like I don't have a 'canonical reference' to go and re-read each time I realize I'm a bit confused. |
cdb0baa
to
791752c
Compare
791752c
to
98e08c0
Compare
submodules should be fixed, I ported all imo the remaining tests can be done in a separate PR. |
42469de
to
b462e7d
Compare
src/test/ui/const-generics/min_const_generics/type-dependent/const-arg-in-const-arg.rs
Outdated
Show resolved
Hide resolved
src/test/ui/const-generics/min_const_generics/type-dependent/const-arg-in-const-arg.rs
Outdated
Show resolved
Hide resolved
src/test/ui/const-generics/min_const_generics/type-dependent/issue-67144-1.rs
Outdated
Show resolved
Hide resolved
These tests are copied from |
They do, min const generics eagerly evaluates constants without supplying the parent generics, IMO this is different enough for us to consider running all tests both with |
⌛ Testing commit 644c894 with merge e4c1ad1de3ced21a64716504511e76edd7622162... |
💔 Test failed - checks-actions |
network failure @bors retry |
☀️ Test successful - checks-actions, checks-azure |
@@ -579,6 +579,9 @@ declare_features! ( | |||
/// Alloc calling `transmute` in const fn | |||
(active, const_fn_transmute, "1.46.0", Some(53605), None), | |||
|
|||
/// The smallest useful subset of `const_generics`. | |||
(active, min_const_generics, "1.46.0", Some(74878), None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 1.47.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, opened #75290
…n, r=jonas-schievink fix `min_const_generics` version rust-lang#74877 (comment) > This should be 1.47.0
Implements both rust-lang/lang-team#37 and rust-lang/compiler-team#332.
Adds the new feature gate
#![feature(min_const_generics)]
.This feature gate adds the following limitations to using const generics:
N
or{ N }
)bool
orchar
.We do allow arbitrary expressions in associated consts though, meaning that the following is allowed,
even if
<[u8; 0] as Foo>::ASSOC
is not const evaluatable.r? @varkor cc @eddyb @withoutboats