-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count stashed errors again #121669
Count stashed errors again #121669
Commits on Feb 29, 2024
-
Don't cancel stashed
OpaqueHiddenTypeMismatch
errors.This gives one extra error message on one test, but is necessary to fix bigger problems caused by the cancellation of stashed errors. (Note: why not just avoid stashing altogether? Because that resulted in additional output changes.)
Configuration menu - View commit details
-
Copy full SHA for c4ec196 - Browse repository at this point
Copy the full SHA c4ec196View commit details -
Don't cancel stashed
TraitMissingMethod
errors.This gives one extra error message on two tests, but is necessary to fix bigger problems caused by the cancellation of stashed errors. (Note: why not just avoid stashing altogether? Because that resulted in additional output changes.)
Configuration menu - View commit details
-
Copy full SHA for ec25d6d - Browse repository at this point
Copy the full SHA ec25d6dView commit details -
Overhaul how stashed diagnostics work, again.
Stashed errors used to be counted as errors, but could then be cancelled, leading to `ErrorGuaranteed` soundness holes. rust-lang#120828 changed that, closing the soundness hole. But it introduced other difficulties because you sometimes have to account for pending stashed errors when making decisions about whether errors have occured/will occur and it's easy to overlook these. This commit aims for a middle ground. - Stashed errors (not warnings) are counted immediately as emitted errors, avoiding the possibility of forgetting to consider them. - The ability to cancel (or downgrade) stashed errors is eliminated, by disallowing the use of `steal_diagnostic` with errors, and introducing the more restrictive methods `try_steal_{modify,replace}_and_emit_err` that can be used instead. Other things: - `DiagnosticBuilder::stash` and `DiagCtxt::stash_diagnostic` now both return `Option<ErrorGuaranteed>`, which enables the removal of two `delayed_bug` calls and one `Ty::new_error_with_message` call. This is possible because we store error guarantees in `DiagCtxt::stashed_diagnostics`. - Storing the guarantees also saves us having to maintain a counter. - Calls to the `stashed_err_count` method are no longer necessary alongside calls to `has_errors`, which is a nice simplification, and eliminates two more `span_delayed_bug` calls and one FIXME comment. - Tests are added for three of the four fixed PRs mentioned below. - `issue-121108.rs`'s output improved slightly, omitting a non-useful error message. Fixes rust-lang#121451. Fixes rust-lang#121477. Fixes rust-lang#121504. Fixes rust-lang#121508.
Configuration menu - View commit details
-
Copy full SHA for 260ae70 - Browse repository at this point
Copy the full SHA 260ae70View commit details -
Mark some once-again-unreachable paths as unreachable.
This undoes the changes from rust-lang#121482 and rust-lang#121586, now that stashed errors will trigger more early aborts.
Configuration menu - View commit details
-
Copy full SHA for b4e9f93 - Browse repository at this point
Copy the full SHA b4e9f93View commit details -
Stop miri if delayed bugs are present.
Seems wise, since it shouldn't proceed in that case.
Configuration menu - View commit details
-
Copy full SHA for 9aff357 - Browse repository at this point
Copy the full SHA 9aff357View commit details -
Reinstate
emit_stashed_diagnostics
inDiagCtxtInner::drop
.I removed it in rust-lang#121206 because I thought thought it wasn't necessary. But then I had to add an `emit_stashed_diagnostics` call elsewhere in rustfmt to avoid the assertion failure (which took two attempts to get right, rust-lang#121487 and rust-lang#121615), and now there's an assertion failure in clippy as well (rust-lang/rust-clippy#12364). So this commit just reinstates the call in `DiagCtxtInner::drop`. It also reverts the rustfmt changes from rust-lang#121487 and rust-lang#121615, though it keeps the tests added for those PRs.
Configuration menu - View commit details
-
Copy full SHA for 82961c0 - Browse repository at this point
Copy the full SHA 82961c0View commit details