-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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. |
||
let mut self_ty = adjusted_ty; | ||
if unsize { | ||
// We only unsize arrays here. | ||
|
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()
.