Skip to content

Manually cleanup token stream when macro expansion aborts.#100250

Merged
bors merged 2 commits intorust-lang:masterfrom
cjgillot:recover-token-stream
Sep 20, 2022
Merged

Manually cleanup token stream when macro expansion aborts.#100250
bors merged 2 commits intorust-lang:masterfrom
cjgillot:recover-token-stream

Conversation

@cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Aug 7, 2022

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.

Loading
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.

Projects

None yet

6 participants