-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 separate array length function #86404
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This is a breaking change, because the method is unstable |
If it's accepted as insta-stable then it is actually not breaking. I can make it this way for CI purposes |
Hmm, is this one of the places where the "avoid unstable methods in name resolution" fix kicks in? Maybe add a ui test, @shamatar, to show what people not using the feature will get, to find out? |
This comment has been minimized.
This comment has been minimized.
Ah, those CI results are enough to say that this is definitely breaking. I'd suggest making a thread in #t-libs on zulip to ask libs how they feel about doing this. |
I'm very surprised that unstable method resolution didn't work with it. So far I'd still argue to mark it as stable and make a crater run with it, but let me ask on Zullip |
Duplicating from Zullip I've made a simple MIR optimization test for a code like
(hacking into SimplifyLocals as the one of the last passes for simplicity, so after any constant prop, and mir-opt-level = 3) here is a MIR
If I make a library modification then At the moment it's not even |
r=@scottmcm It passes all the tests on local, can you please check my guess on making it insta-stable and may be start a CI and potentially crater run? rust/library/core/src/array/mod.rs Lines 400 to 405 in 189342d
|
"Waiting for review" is not assigned even after |
Everyone can use the following though: @rustbot label -S-waiting-on-author +S-waiting-on-review |
Since this is now insta-stable, I've marked it as needs-fcp and will send it over to r? @m-ou-se as they're active in the zulip conversation about it. |
Workaround of this would be #86525 |
@bors try @rust-timer queue per the request in #86525 (comment) |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 189342d with merge 2e412375b3fd677ce07a0ddbd9809b06316d15d1... |
☀️ Try build successful - checks-actions |
Queued 2e412375b3fd677ce07a0ddbd9809b06316d15d1 with parent 8cb207a, future comparison URL. |
Finished benchmarking try commit (2e412375b3fd677ce07a0ddbd9809b06316d15d1): comparison url. Summary: This benchmark run did not return any significant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. 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 |
On average this seems to be a slight perf improvement up to 0.6%, but there are also several regressions up to 0.8%. |
That performance run was to compare against MIR pass that achieves the same, but I'd expect it to be neutral at the end of the day, and it looks so |
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[rustc_const_stable(feature = "array_len", since = "1.53.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.
I think the #[stable]
feature and version should be the same as the one for #[rustc_const_stable]
?
That PR has merged now, so I think this one can be closed, right? |
Solves #86403