Manually cleanup token stream when macro expansion aborts.#100250
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 20, 2022
Merged
Manually cleanup token stream when macro expansion aborts.#100250bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
r? @Aaron1011 |
Contributor
|
My concern is that this could lead to compilation incorrectly succeeding, since we don't have access to a ParseSess to call delay_span_bug |
Collaborator
|
☔ The latest upstream changes (presumably #101757) made this pull request unmergeable. Please resolve the merge conflicts. |
e0759e3 to
cb5ea8d
Compare
Contributor
|
Thanks! |
Collaborator
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Sep 20, 2022
…aron1011 Manually cleanup token stream when macro expansion aborts. In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE. In this case, this PR manually cleans up the token stream by closing all currently open delimiters. Fixes rust-lang#96818. Fixes rust-lang#80447. Fixes rust-lang#81920. Fixes rust-lang#91023.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 20, 2022
Rollup of 12 pull requests Successful merges: - rust-lang#100250 (Manually cleanup token stream when macro expansion aborts.) - rust-lang#101014 (Fix -Zmeta-stats ICE by giving `FileEncoder` file read permissions) - rust-lang#101958 (Improve error for when query is unsupported by crate) - rust-lang#101976 (MirPhase: clarify that linting is not a semantic change) - rust-lang#102001 (Use LLVM C-API to build atomic cmpxchg and fence) - rust-lang#102008 (Add GUI test for notable traits element position) - rust-lang#102013 (Simplify rpitit handling on lower_fn_decl) - rust-lang#102021 (some post-valtree cleanup) - rust-lang#102027 (rustdoc: remove `docblock` class from `item-decl`) - rust-lang#102034 (rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`) - rust-lang#102038 (Make the `normalize-overflow` rustdoc test actually do something) - rust-lang#102053 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE.
In this case, this PR manually cleans up the token stream by closing all currently open delimiters.
Fixes #96818.
Fixes #80447.
Fixes #81920.
Fixes #91023.