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

Visit param_env field in Obligation's TypeFoldable impl #91205

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

Aaron1011
Copy link
Member

This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.

@rust-highfive
Copy link
Collaborator

r? @jackh726

(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 24, 2021
@Aaron1011
Copy link
Member Author

I'm not sure why this resulted in diagnostic changes - cc @estebank @lcnr @BoxyUwU

@estebank
Copy link
Contributor

I'm not sure either 🙃

@camelid camelid added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 25, 2021
@lcnr
Copy link
Contributor

lcnr commented Nov 25, 2021

the output probably changed cause the param_env of the obligation also contained an erroneous anon const which we previously did not compute for whatever reason 🤷

slightly prefer to keep the old formatting here, apart from that r=me

r? @lcnr

@Aaron1011
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 25, 2021

📌 Commit d7e8212 has been approved by lcnr

@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 25, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 25, 2021
Visit `param_env` field in Obligation's `TypeFoldable` impl

This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 25, 2021
Visit `param_env` field in Obligation's `TypeFoldable` impl

This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.
@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 Nov 25, 2021
This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.
@Aaron1011
Copy link
Member Author

I've blessed the Clippy test.

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 25, 2021

📌 Commit a7cc6bc has been approved by lcnr

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2021
@bors
Copy link
Contributor

bors commented Nov 26, 2021

⌛ Testing commit a7cc6bc with merge 1e79d79...

@bors
Copy link
Contributor

bors commented Nov 26, 2021

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 1e79d79 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 26, 2021
@bors bors merged commit 1e79d79 into rust-lang:master Nov 26, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 26, 2021
Aaron1011 added a commit to Aaron1011/rust that referenced this pull request Nov 26, 2021
Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1e79d79): comparison url.

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

  • Very large regression in instruction counts (up to 6.6% on full builds of hyper-2)

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

@rustbot rustbot added the perf-regression Performance regression. label Nov 26, 2021
@estebank
Copy link
Contributor

Can someone file a ticket to follow up with changing the output here? Inference errors outside of expression context are very confusing to people.

@Aaron1011
Copy link
Member Author

@estebank I've opened #91254 to fix this

@Aaron1011
Copy link
Member Author

The perf regression is really unfortunate - I had hoped that #91254 would allow us to recover some of the loss, but it appears to have no impact.

I'll see if there are any call sites that don't actually care about the ParamEnv, and could be adjusted to just visit the predicate. However, this is a correctness fix, do I'm not sure how much can be done to improve the performance.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 27, 2021
…lcnr

Only check for errors in predicate when skipping impl assembly

Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
Aaron1011 added a commit to Aaron1011/rust that referenced this pull request Nov 27, 2021
Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 28, 2021
…lcnr

Only check for errors in predicate when skipping impl assembly

Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 2, 2021
Visit `param_env` field in Obligation's `TypeFoldable` impl

This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 2, 2021
Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
pietroalbini pushed a commit to pietroalbini/rust that referenced this pull request Jan 19, 2022
Prior to PR rust-lang#91205, checking for errors in the overall obligation
would check checking the `ParamEnv`, due to an incorrect
`super_visit_with` impl. With this bug fixed, we will now
bail out of impl candidate assembly if the `ParamEnv` contains
any error types.

In practice, this appears to be overly conservative - when an error
occurs early in compilation, we end up giving up early for some
predicates that we could have successfully evaluated without overflow.
By only checking for errors in the predicate itself, we avoid causing
additional spurious 'type annotations needed' errors after a 'real'
error has already occurred.

With this PR, the diagnostic changes caused by PR rust-lang#91205 are reverted.
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. 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.

10 participants