Skip to content
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

Merged
merged 1 commit into from
Nov 28, 2020
Merged

Conversation

bugadani
Copy link
Contributor

This PR removes two short lived vectors that don't serve any obvious purpose.

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 27, 2020
@jonas-schievink
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Nov 27, 2020

⌛ Trying commit d212ea7 with merge d5c9c1e547e10238445959959dbad36c60f2944b...

@bors
Copy link
Contributor

bors commented Nov 27, 2020

☀️ Try build successful - checks-actions
Build commit: d5c9c1e547e10238445959959dbad36c60f2944b (d5c9c1e547e10238445959959dbad36c60f2944b)

@rust-timer
Copy link
Collaborator

Queued d5c9c1e547e10238445959959dbad36c60f2944b with parent 72d2a7c, future comparison URL.

@rust-timer
Copy link
Collaborator

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 rollup- to bors.

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
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-perf

@jonas-schievink
Copy link
Contributor

No perf impact, but the code is cleaner.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 27, 2020

📌 Commit d212ea7 has been approved by jonas-schievink

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2020
}
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))
Copy link
Contributor

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

Copy link
Contributor Author

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.

@bugadani
Copy link
Contributor Author

Cycle counts show a much bigger difference than instruction counts. Is that something I can rely on here?

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2020
…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
@bors bors merged commit fe9a02c into rust-lang:master Nov 28, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 28, 2020
@bugadani bugadani deleted the simplify branch November 28, 2020 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants