-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Report fatal lexer errors in --cfg
command line arguments
#89468
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Oct 2, 2021
apiraino
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Oct 14, 2021
r? rust-lang/compiler |
😂 |
@bors r+ rollup |
📌 Commit 041212f has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Oct 22, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 23, 2021
…askrgr Rollup of 11 pull requests Successful merges: - rust-lang#83233 (Implement split_array and split_array_mut) - rust-lang#88300 (Stabilise unix_process_wait_more, extra ExitStatusExt methods) - rust-lang#89416 (nice_region_error: Include lifetime placeholders in error output) - rust-lang#89468 (Report fatal lexer errors in `--cfg` command line arguments) - rust-lang#89730 (add feature flag for `type_changing_struct_update`) - rust-lang#89920 (Implement -Z location-detail flag) - rust-lang#90070 (Add edition configuration to compiletest) - rust-lang#90087 (Sync rustfmt subtree) - rust-lang#90117 (Make RSplit<T, P>: Clone not require T: Clone) - rust-lang#90122 (CI: make docker cache download and `docker load` time out after 10 minutes) - rust-lang#90166 (Add comment documenting why we can't use a simpler solution) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
pushed a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 1, 2022
Fixes rust-lang#73026 See also: rust-lang#64467, rust-lang#89468 The issue stems from a `FatalError` being silently raised in `panictry_buffer`. Normally this is not a problem, because `panictry_buffer` emits the causes of the error, but they are not themselves fatal, so they get filtered out by the silent emitter. To fix this, we use a parser entrypoint which doesn't use `panictry_buffer`, and we handle the error ourselves.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 1, 2022
Emit an error for `--cfg=)` Fixes rust-lang#73026 See also: rust-lang#64467, rust-lang#89468 The issue stems from a `FatalError` being silently raised in `panictry_buffer`. Normally this is not a problem, because `panictry_buffer` emits the causes of the error, but they are not themselves fatal, so they get filtered out by the silent emitter. To fix this, we use a parser entrypoint which doesn't use `panictry_buffer`, and we handle the error ourselves.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #89358. The erroneous behavior was apparently introduced by @Mark-Simulacrum in a678e31; the idea is to silence individual parser errors and instead emit one catch-all error message after parsing. However, for the example in #89358, a fatal lexer error is created here:
rust/compiler/rustc_parse/src/lexer/mod.rs
Lines 340 to 349 in edebf77
This fatal error aborts the compilation, and so the call to
new_parser_from_source_str()
never returns and the catch-all error message is never emitted. I have therefore changed theSilentEmitter
to silence only non-fatal errors; with my changes, for the rustc invocation described in #89358:rustc --cfg "abc\""
I get the following output: