-
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
Remove some unchecked_claim_error_was_emitted
calls
#120735
Commits on Feb 6, 2024
-
Remove return value from
emit_stashed_diagnostics
.It's never used.
Configuration menu - View commit details
-
Copy full SHA for 8d1c20a - Browse repository at this point
Copy the full SHA 8d1c20aView commit details
Commits on Feb 7, 2024
-
Remove an
unchecked_claim_error_was_emitted
call.When `catch_fatal_errors` catches a `FatalErrorMarker`, it returns an `ErrorGuaranteed` that is conjured out of thin air with `unchecked_claim_error_was_emitted`. But that `ErrorGuaranteed` is never used. This commit changes it to instead conjure a `FatalError` out of thin air. (A non-deprecated action!) This makes more sense because `FatalError` and `FatalErrorMarker` are a natural pairing -- a `FatalErrorMarker` is created by calling `FatalError::raise`, so this is effectively getting back the original `FatalError`. This requires a tiny change in `catch_with_exit_code`. The old result of the `catch_fatal_errors` call there was `Result<Result<(), ErrorGuaranteed>, ErrorGuaranteed>` which could be `flatten`ed into `Result<(), ErrorGuaranteed>`. The new result of the `catch_fatal_errors` calls is `Result<Result<(), ErrorGuaranteed>, FatalError>`, which can't be `flatten`ed but is still easily matched for the success case.
Configuration menu - View commit details
-
Copy full SHA for e55df62 - Browse repository at this point
Copy the full SHA e55df62View commit details -
rustdoc: make
main
more like rustc's.By making non-unicode arguments a fatal error instead of a warning, we don't need to handle what comes after, which avoids the need for an `unchecked_claim_error_was_emitted` call.
Configuration menu - View commit details
-
Copy full SHA for e6794dd - Browse repository at this point
Copy the full SHA e6794ddView commit details -
rustdoc: remove
unchecked_claim_error_was_emitted
call inmain_args
.`main_args` calls `from_matches`, which does lots of initialization. If anything goes wrong, `from_matches` emits an error message and returns `Err(1)` (or `Err(3)`). `main_args` then turns the `Err(1)` into `Err(ErrorGuaranteed)`, because that's what `catch_with_exit_code` requires on error. But `catch_with_exit_code` doesn't do anything with the `ErrorGuaranteed`, it just exits with `EXIT_FAILURE`. We can avoid the creation of the `ErrorGuaranteed` (which requires an undesirable `unchecked_claim_error_was_emitted` call), by changing `from_matches` to instead eagerly abort if anything goes wrong. The behaviour from the user's point of view is the same: an early abort with an `EXIT_FAILURE` exit code. And we can also simplify `from_matches` to return an `Option` instead of a `Result`: - Old `Err(0)` case --> `None` - Old `Err(_)` case --> fatal error. This requires similar changes to `ScrapeExamplesOptions::new` and `load_call_locations`.
Configuration menu - View commit details
-
Copy full SHA for 83adf88 - Browse repository at this point
Copy the full SHA 83adf88View commit details -
Tighten up
ErrorGuaranteed
handling.- In `emit_producing_error_guaranteed`, only allow `Level::Error`. - In `emit_diagnostic`, only produce `ErrorGuaranteed` for `Level` and `DelayedBug`. (Not `Bug` or `Fatal`. They don't need it, because the relevant `emit` methods abort.) - Add/update various comments.
Configuration menu - View commit details
-
Copy full SHA for 97c157f - Browse repository at this point
Copy the full SHA 97c157fView commit details -
Rename
unchecked_claim_error_was_emitted
as `unchecked_error_guaran……teed`. It's more to-the-point.
Configuration menu - View commit details
-
Copy full SHA for 6889fe3 - Browse repository at this point
Copy the full SHA 6889fe3View commit details