]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #73005 - Aaron1011:fix/error-overflow, r=estebank
authorDylan DPC <dylan.dpc@gmail.com>
Wed, 10 Jun 2020 09:03:43 +0000 (11:03 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2020 09:03:43 +0000 (11:03 +0200)
commit024f025934a40056364be4a4da4f7e078b419f68
treee8b0453ef74fcbc918fca69305a3020dab35b90e
parent8addb2e684dfbe0cd2e16a769485a093f9b2de32
parentae42c91c6517517e831b12e0f4a98d538b4a19b5
Rollup merge of #73005 - Aaron1011:fix/error-overflow, r=estebank

Don't create impl candidates when obligation contains errors

Fixes #72839

In PR #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.