-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
creating a TypeErrCtxt should only be possible if we emit an error #108810
Copy link
Copy link
Closed
Labels
A-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
there are a lot of methods on
TypeErrCtxtwhich should only be used for diagnostics. To assert that this is the case we should emit adelay_span_bugwhen creating (or probably when dropping so that-Ztreat-err-as-bugkeeps working nicely) this context.This means that we can't use
infcx.err_ctxt().check_region_obligations_and_report_errors()as that creates aTypeErrCtxteven though we don't emit any error.Its probably easiest to use the same split as
select_all_or_error, always usingresolve_regionswhich returns a#[must_use]list of errors and then manually callingreport_region_errors