Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't create impl candidates when obligation contains errors
Fixes rust-lang#72839 In PR rust-lang#72621, trait selection was modified to no longer bail out early when an error type was encountered. This allowed us treat `ty::Error` as `Sized`, causing us to avoid emitting a spurious "not sized" error after a type error had already occured. However, this means that we may now try to match an impl candidate against the error type. Since the error type will unify with almost anything, this can cause us to infinitely recurse (eventually triggering an overflow) when trying to verify certain `where` clauses. This commit causes us to skip generating any impl candidates when an error type is involved.
- Loading branch information