]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #104269 - compiler-errors:hang-in-where-clause-sugg, r=lcnr
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Wed, 23 Nov 2022 15:02:35 +0000 (20:32 +0530)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2022 15:02:35 +0000 (20:32 +0530)
commitbd91c94a5d744e0f93aff073bdbb69d0f4e8d9f6
tree7796e86984ee33de8899878a240592e49a22fe15
parent4e0d0d757e2f1b61ec809420b006545a9f8974c0
parent9decfff6f87d3e5760fd61375c3d27fa45a83e52
Rollup merge of #104269 - compiler-errors:hang-in-where-clause-sugg, r=lcnr

Fix hang in where-clause suggestion with `predicate_can_apply`

Using `predicate_may_hold` during error reporting causes an evaluation overflow, which (because we use `evaluate_obligation_no_overflow`) then causes the predicate to need to be re-evaluated locally, which results in a hang.

... but since the "add a where clause" suggestion is best-effort, just throw any overflow errors. No need for 100% accuracy.

r? `@lcnr` who has been thinking about overflows... Let me know if you want more context about this issue, and as always, feel free to reassign.

Fixes #104225
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs