-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add #[rustc_legacy_const_generics] #82447
Conversation
f2e91d5
to
d87eec1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The current implementation is not very well optimized, let's see how bad it is... @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 00eca69 with merge 6d7225329e02f2f6fc73dfb977e802102a412bff... |
☀️ Try build successful - checks-actions |
Queued 6d7225329e02f2f6fc73dfb977e802102a412bff with parent fe1bf8e, future comparison URL. |
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.
I think we should ignore the same-crate situation and just not do anything there. If you can write functions with const generics you can change your call sites, too.
Finished benchmarking try commit (6d7225329e02f2f6fc73dfb977e802102a412bff): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Ok, it does have a measurable impact. So... one way to optimize this would be to write the list of all Though... I'm not sure if this is actually a bottleneck at all since there seem to be no additional calls/decodings of |
I think part of the overhead comes from returning a |
This comment has been minimized.
This comment has been minimized.
I've addressed the review comments and have attempted to address the performance issues using my favored strategy of throwing a @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Finished benchmarking try commit (96bc946ebd85c25f0f05e1b979e8f996be1a1daf): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Perf looks much better now :) |
@oli-obk Ready for review. |
@bors r+ |
📌 Commit 00afbe7 has been approved by |
⌛ Testing commit 00afbe7 with merge 80c5a3d003b0f4610bddd0dd4237980f6f21d9a5... |
💔 Test failed - checks-actions |
A lot of builders passed, let's try again @bors retry |
☀️ Test successful - checks-actions |
This is the first step towards removing
#[rustc_args_required_const]
: a new attribute is added which rewrites function calls of the formfunc(a, b, c)
tofunc::<{b}>(a, c)
. This allows previously stabilized functions instdarch
which userustc_args_required_const
to use const generics instead.This new attribute is not intended to ever be stabilized, it is only intended for use in
stdarch
as a replacement for#[rustc_args_required_const]
.r? @oli-obk