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

instance: only polymorphize upvar substs #75337

Merged
merged 1 commit into from Aug 11, 2020

Conversation

davidtwco
Copy link
Member

This PR restricts the substitution polymorphization added in #75255 to only apply to the tupled upvar substitution, rather than all substitutions, fixing a bunch of regressions when polymorphization is
enabled.

Due to an oversight on my part, when landing #75260 and #75255, some tests started failing when polymorphization was enabled that I didn't notice until after landing - this PR fixes the regressions from #75255. #75336 has been filed to make sure that we don't forget to try make this change again in future, as it does enable some optimisations.

r? @lcnr

This commit restricts the substitution polymorphization added in rust-lang#75255
to only apply to the tupled upvar substitution, rather than all
substitutions, fixing a bunch of regressions when polymorphization is
enabled.

Signed-off-by: David Wood <david@davidtw.co>
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 9, 2020
Comment on lines +495 to +498
// If this is a closure or generator then we need to handle the case where another closure
// from the function is captured as an upvar and hasn't been polymorphized. In this case,
// the unpolymorphized upvar closure would result in a polymorphized closure producing
// multiple mono items (and eventually symbol clashes).
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we should move back to not tracking that information in the ty::Closure at all. cc @nikomatsakis

@eddyb
Copy link
Member

eddyb commented Aug 9, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Aug 9, 2020

📌 Commit fd41bde has been approved by eddyb

@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 Aug 9, 2020
@lcnr lcnr assigned eddyb and unassigned lcnr Aug 10, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#75098 (Clippy pointer cast lint experiment)
 - rust-lang#75249 (Only add a border for the rust logo)
 - rust-lang#75315 (Avoid deleting temporary files on error)
 - rust-lang#75316 (Don't try to use wasm intrinsics on vectors)
 - rust-lang#75337 (instance: only polymorphize upvar substs)
 - rust-lang#75339 (evaluate required_consts when pushing stack frame in Miri engine)
 - rust-lang#75363 (Use existing `infcx` when emitting trait impl diagnostic)
 - rust-lang#75366 (Add help button)
 - rust-lang#75369 (Move to intra-doc links in /library/core/src/borrow.rs)
 - rust-lang#75379 (Use intra-doc links in /library/core/src/cmp.rs)

Failed merges:

r? @ghost
@bors bors merged commit 1e41af3 into rust-lang:master Aug 11, 2020
@davidtwco davidtwco deleted the polymorphization-75255-fixes branch August 11, 2020 13:54
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

5 participants