-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use the now available implementation of IntoIterator
for arrays
#86311
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
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -938,7 +938,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) { | |||
if !remaining_lib_features.is_empty() { | |||
check_features(&mut remaining_lib_features, &local_defined_features); | |||
|
|||
for &cnum in &*tcx.crates() { | |||
for &cnum in tcx.crates() { |
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.
Is the leading & still necessary?
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.
tcx.crates()
is a slice (&'tcx [CrateNum]
), so I guess we either have to write &cnum
or *tcx.crates()
.
@bors try @rust-timer queue This is nice to land either way, but I suspect it might be marginally faster. |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e3ca81f with merge 757fd2dd198bc97dce4a56245d380a4a37037329... |
☀️ Try build successful - checks-actions |
Queued 757fd2dd198bc97dce4a56245d380a4a37037329 with parent 3044419, future comparison URL. |
Finished benchmarking try commit (757fd2dd198bc97dce4a56245d380a4a37037329): 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 |
@bors r+ |
📌 Commit e3ca81f has been approved by |
@@ -82,7 +82,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
expr, base_expr, adjusted_ty, index_ty | |||
); | |||
|
|||
for &unsize in &[false, true] { | |||
for unsize in [false, true] { |
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.
Not something that needs changing in this PR: I wonder, in general, how perf differs between copying an array vs slice-iterating the rvalue-static-promoted one.
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.
See the perf run, looks like not much: #86311 (comment). But it might just be because these aren't in perf-sensitive parts of the compiler.
☀️ Test successful - checks-actions |
No description provided.