Error tainting in parallel compiler #126485
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-compiler-parallel
Working group: Parallelizing the compiler
Emitting diagnostics in one thread taints every infcx out there, but other threads don't expect their infcx to become tainted if they themselves aren't emitting anything. This leads to skipped diagnostics, early bailing out of queries that could've run to completion or painful to debug ICEs. For example, take #120601: snippet below run with
-Zthreads=3 --edition=2021
works, but crashes if you uncomment the last function.In parallel compiler, code that does different things depending on the result of
InferCtxt::tainted_by_errors()
can introduce spurious failures or even replace previously resolvedTy
's withTy::new_error()
:rust/compiler/rustc_borrowck/src/nll.rs
Line 202 in f9515fd
in
regioncx.infer_opaque_types
:rust/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
Lines 133 to 134 in f9515fd
rust/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
Lines 278 to 285 in f9515fd
relevant part of
InferCtxt
:rust/compiler/rustc_infer/src/infer/mod.rs
Lines 1219 to 1239 in f9515fd
The text was updated successfully, but these errors were encountered: