Visit param_env field in Obligation's TypeFoldable impl by Aaron1011 · Pull Request #91205 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation16 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Aaron1011

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

@rust-highfive

r? @jackh726

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

@Aaron1011

@estebank

camelid

@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

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

@bors

📌 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

@matthiaskrgr

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

@matthiaskrgr

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

@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

@Aaron1011

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

@Aaron1011

I've blessed the Clippy test.

@bors r=lcnr

@bors

📌 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

@bors

Aaron1011 added a commit to Aaron1011/rust that referenced this pull request

Nov 26, 2021

@Aaron1011

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

Finished benchmarking commit (1e79d79): comparison url.

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

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

@estebank

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

@Aaron1011

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

@matthiaskrgr

…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

@Aaron1011

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

@matthiaskrgr

…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

@bors

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

@Aaron1011

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

@Aaron1011 @pietroalbini

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.

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.