]> git.lizzy.rs Git - rust.git/commitdiff
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)
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

1  2 
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs