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

Replace tuple of infer vars for upvar_tys with single infer var #77873

Merged
merged 4 commits into from
Oct 15, 2020

Conversation

roxelo
Copy link
Member

@roxelo roxelo commented Oct 12, 2020

This commit allows us to decide the number of captures required after
completing capture ananysis, which is required as part of implementing
RFC-2229.

closes rust-lang/project-rfc-2229#4
r? @nikomatsakis

roxelo and others added 3 commits October 11, 2020 03:32
This commit allows us to decide the number of captures required after
completing capture ananysis, which is required as part of implementing
RFC-2229.

Co-authored-by: Aman Arora <[email protected]>
Co-authored-by: Jenny Wills <[email protected]>
Depending on if upvar_tys inferred or not, we were returning either an
inference variable which later resolves to a tuple or else the upvar tys
themselves

Co-authored-by: Roxane Fruytier <[email protected]>
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @lcnr (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 12, 2020
@arora-aman
Copy link
Member

r? @nikomatsakis

@roxelo roxelo changed the title Use tuple inference for closures and generators Replace tuple of infer vars for upvar_tys with single infer var Oct 12, 2020
@roxelo roxelo marked this pull request as ready for review October 12, 2020 22:19
@nikomatsakis nikomatsakis self-assigned this Oct 12, 2020
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great -- I left some comments on how we could simplify, some of which I see now were outdated by later commits, but not all of them I think.

compiler/rustc_middle/src/ty/outlives.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/outlives.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/print/pretty.rs Show resolved Hide resolved
compiler/rustc_trait_selection/src/opaque_types.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/opaque_types.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/traits/select/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/traits/select/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_traits/src/dropck_outlives.rs Show resolved Hide resolved
compiler/rustc_traits/src/dropck_outlives.rs Show resolved Hide resolved
@arora-aman
Copy link
Member

@nikomatsakis updated

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 14, 2020

📌 Commit a64ad51 has been approved by nikomatsakis

@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 Oct 14, 2020
@bors
Copy link
Contributor

bors commented Oct 14, 2020

⌛ Testing commit a64ad51 with merge 24ca6e8ea039d1dad6de4c10cb036cc6cd241d81...

@bors
Copy link
Contributor

bors commented Oct 14, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 14, 2020
@Dylan-DPC-zz
Copy link

@bors retry

@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 Oct 14, 2020
@bors
Copy link
Contributor

bors commented Oct 15, 2020

⌛ Testing commit a64ad51 with merge 93deabc...

@bors
Copy link
Contributor

bors commented Oct 15, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: nikomatsakis
Pushing 93deabc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 15, 2020
@bors bors merged commit 93deabc into rust-lang:master Oct 15, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 15, 2020
@arora-aman arora-aman deleted the use_tuple_inference_for_closures branch October 21, 2020 09:47
@Mark-Simulacrum
Copy link
Member

This appears to be a 3% regression on the wg-grammar benchmark, though wall times look like they're overall an improvement. Since this is appears to be a functional (not perf-related) change I am inclined to not do anything further here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Always make the "upvar types" a tuple of the actual upvar types (Parent issue#53488)
9 participants