Uh oh!
There was an error while loading. Please reload this page.
implement feature(const_generics_defaults) - #75384
Conversation
bors
commented
Aug 11, 2020
☔ The latest upstream changes (presumably #75383) made this pull request unmergeable. Please resolve the merge conflicts. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lcnr
commented
Aug 11, 2020
Hmm, I am not sure how easy it is to start here and think that's it's probably better to start by actually parsing Do we want to implement this as part of Also, while I will review this, I won't merge it myself, so r? @varkor |
Uh oh!
There was an error while loading. Please reload this page.
ce46be1 to
705cbf7Comparevarkor
commented
Aug 11, 2020
I think if we're going to make any progress with defaults for const generics, we ought to try to implement them in a single PR, or at least bigger steps than this. Otherwise we risk making implementation choices that aren't the best in practice, and then refactoring unnecessarily later. You're welcome to try implementing defaults, though: I think we'll want an extra feature flag |
Hm I think I added all the points where I saw the |
varkor
commented
Aug 14, 2020
Oh, sorry, I hadn't actually looked at the changes yet. Maybe this actually isn't too far off a minimal working implementation? Maybe if you tried implementing the parser changes, we could get a better idea of what does or doesn't work? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
34c40c6 to
052e043Comparebors
commented
Aug 17, 2020
☔ The latest upstream changes (presumably #75609) made this pull request unmergeable. Please resolve the merge conflicts. |
JulianKnodt
commented
Aug 17, 2020
Hm I'm a little stuck at this point, I'm not particularly sure where the error could be originating from. |
JohnCSimon
commented
Sep 1, 2020
@JulianKnodt - ping from triage, can you please address the merge conflicts? |
6c0b4ca to
2ab5e69CompareA bunch of nits fixed, and a new test for pretty printing the AST.
lcnr
commented
Mar 23, 2021
@bors r=varkor,lcnr |
bors
commented
Mar 23, 2021
📌 Commit 8e14ede961f4e2e0c89ad7a1a1cbd98a975abe9f has been approved by |
lcnr
commented
Mar 23, 2021
bors
commented
Mar 23, 2021
✌️ @JulianKnodt can now approve this pull request |
lcnr
commented
Mar 23, 2021
@bors r=varkor,lcnr rollup=never |
bors
commented
Mar 23, 2021
📌 Commit 33370fd has been approved by |
Dylan-DPC-zz
commented
Mar 23, 2021
@bors retry |
bors
commented
Mar 23, 2021
⌛ Testing commit 33370fd with merge c964c9ae35ee07abd1712a8f902a6f3852d059bb... |
rust-log-analyzer
commented
Mar 24, 2021
bors
commented
Mar 24, 2021
💔 Test failed - checks-actions |
varkor
commented
Mar 24, 2021
@bors retry |
bors
commented
Mar 24, 2021
bors
commented
Mar 24, 2021
☀️ Test successful - checks-actions |
varkor
commented
Mar 24, 2021
@JulianKnodt: thank you for all your hard work pushing this feature to completion! |
rylev
commented
Apr 1, 2021
@JulianKnodt@varkor - there was a slight performance regression seen after a performance run of this change. It's fairly small and it only impacts one benchmark which does not use const generics at all. The specific query impacted is |
JulianKnodt
commented
Apr 1, 2021
Probably CGU partitioning changed after the queries changed? |
I'd also say this is expected perf change given what this does. |
Implements const generics defaults
struct Example<const N: usize=3>, as well as a query for getting the default of a given const-parameter's def id. There are some remaining FIXME's but they were specified as not blocking for merging this PR. This also puts the defaults behind the unstable feature gate#![feature(const_generics_defaults)].This currently creates a field which is always false onGenericParamDefKindfor future use whenconsts are permitted to have defaults. I'm not sure if this is exactly what is best for adding default parameters, but I mimicked the style of type defaults, so hopefully this is ok.
r? @lcnr