-
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
Remove intermediate vectors from add_bounds
#79460
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit d212ea7 with merge d5c9c1e547e10238445959959dbad36c60f2944b... |
☀️ Try build successful - checks-actions |
Queued d5c9c1e547e10238445959959dbad36c60f2944b with parent 72d2a7c, future comparison URL. |
Finished benchmarking try commit (d5c9c1e547e10238445959959dbad36c60f2944b): 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 |
No perf impact, but the code is cleaner. @bors r+ rollup |
📌 Commit d212ea7 has been approved by |
} | ||
hir::GenericBound::Trait(_, hir::TraitBoundModifier::Maybe) => {} | ||
hir::GenericBound::LangItemTrait(lang_item, span, hir_id, args) => self | ||
.instantiate_lang_item_trait_ref( | ||
lang_item, span, hir_id, args, param_ty, bounds, | ||
), | ||
hir::GenericBound::Outlives(ref l) => region_bounds.push(l), | ||
hir::GenericBound::Outlives(ref l) => { | ||
bounds.region_bounds.push((self.ast_region_to_region(l, None), l.span)) |
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.
The only reason for the design that I can see is that maybe the calls to ast_region_to_region
must come after all calls to instantiate_poly_trait_ref
are done. The only reason that can happen is if there are inference lifetimes in these bounds. Basically all that can happen is that some ids (created here) are now in a different order, which seems fine to me.
so the TLDR is that I think this change is fine
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.
Hmm I didn't consider the order of things.
Cycle counts show a much bigger difference than instruction counts. Is that something I can rely on here? |
…as-schievink Rollup of 10 pull requests Successful merges: - rust-lang#78086 (Improve doc for 'as _') - rust-lang#78853 (rustc_parse: fix ConstBlock expr span) - rust-lang#79234 (Resolve typedefs in HashMap gdb/lldb pretty-printers) - rust-lang#79344 (Convert UNC path to local path to satisfy install script on Windows) - rust-lang#79383 (Fix bold code formatting in keyword docs) - rust-lang#79460 (Remove intermediate vectors from `add_bounds`) - rust-lang#79474 (Change comments on types to doc-comments) - rust-lang#79476 (Sync rustc_codegen_cranelift) - rust-lang#79478 (Expand docs on Peekable::peek_mut) - rust-lang#79486 (Slightly improve code samples in E0591) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This PR removes two short lived vectors that don't serve any obvious purpose.