The meaning of this assertion changed in #120828 when the meaning of `has_errors` changed to exclude stashed errors. Evidently the new meaning is too restrictive. Fixes #120856.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.