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

Actually instantiate the opaque type when checking bounds #90948

Merged
merged 2 commits into from
Jan 11, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Nov 16, 2021

Before this change, instantiate_opaque_types was a no-op, because it only works relative to the defined opaque type inference anchor. If it is a no-op, the for loop will not actually have anything to iterate over, and thus nothing is checked at all.

@rust-highfive
Copy link
Collaborator

r? @cjgillot

(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 16, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 18, 2021
@cjgillot
Copy link
Contributor

I don't know anything of that code.
@matthewjasper could you take over?

@spastorino
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 1, 2021

📌 Commit 238083112590fe0c35943e1c79193171cd32c68c has been approved by spastorino

@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 Dec 1, 2021
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 1, 2021

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 1, 2021
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 1, 2021

@bors try @rust-timer queue

realized that we should check perf first.

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 1, 2021
@bors
Copy link
Contributor

bors commented Dec 1, 2021

⌛ Trying commit 9a3869be7dfcde5bdb730b97a722dcd79b1ceb2c with merge 3b3c064b69de9fe9bdef07dc74be3526862a2266...

@bors
Copy link
Contributor

bors commented Dec 1, 2021

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

@rust-timer
Copy link
Collaborator

Queued 3b3c064b69de9fe9bdef07dc74be3526862a2266 with parent f04a2f4, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3b3c064b69de9fe9bdef07dc74be3526862a2266): comparison url.

Summary: This change led to moderate relevant regressions 😿 in compiler performance.

  • Moderate regression in instruction counts (up to 1.2% on full builds of wg-grammar)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 1, 2021
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 2, 2021

This regresses check_mod_item_types a bit, but that is expected as we are now double checking impl trait in return position. We don't have any problems due to not checking here, so I can't write a test, but it's very fragile to depend on ad hoc checks happening for impl trait (as evident in my currently unpublished PR), so I'd rather merge this PR with the slight perf regression.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 2, 2021

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Dec 2, 2021
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 9, 2021

r? @nikomatsakis since you expressed some preference for the double-checking

Before this change, `instantiate_opaque_types` was a no-op
While not necessary right now, this is the safe choice and will
be necessary for lazy TAIT.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2022

📌 Commit 15f7e81 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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 11, 2022
@bors
Copy link
Contributor

bors commented Jan 11, 2022

⌛ Testing commit 15f7e81 with merge 1409c01...

@bors
Copy link
Contributor

bors commented Jan 11, 2022

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 1409c01 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 11, 2022
@bors bors merged commit 1409c01 into rust-lang:master Jan 11, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 11, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1409c01): comparison url.

Summary: This change led to moderate relevant regressions 😿 in compiler performance.

  • Moderate regression in instruction counts (up to 1.2% on full builds of wg-grammar)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 12, 2022

This regresses check_mod_item_types a bit, but that is expected as we are now double checking impl trait in return position. We don't have any problems due to not checking here at present, so I can't write a test, but it's very fragile to depend on ad hoc checks happening for impl trait (as evident in #92007),

@rustbot label: +perf-regression-triaged

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 14, 2022
Don't fall back to crate-level opaque type definitions.

That would just hide bugs, as it works accidentally if the opaque type is defined at the crate level.

Only works after rust-lang#90948 which worked by accident for our entire test suite.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 14, 2022
Don't fall back to crate-level opaque type definitions.

That would just hide bugs, as it works accidentally if the opaque type is defined at the crate level.

Only works after rust-lang#90948 which worked by accident for our entire test suite.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 14, 2022
Don't fall back to crate-level opaque type definitions.

That would just hide bugs, as it works accidentally if the opaque type is defined at the crate level.

Only works after rust-lang#90948 which worked by accident for our entire test suite.
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants