Skip to content

fix: When descending tokens don't bail on failed macro call expansions#10127

Merged
bors[bot] merged 1 commit into
rust-lang:masterfrom
Veykril:descend
Sep 2, 2021
Merged

fix: When descending tokens don't bail on failed macro call expansions#10127
bors[bot] merged 1 commit into
rust-lang:masterfrom
Veykril:descend

Conversation

@Veykril

@Veykril Veykril commented Sep 2, 2021

Copy link
Copy Markdown
Member

(with #[test] expansion enabled)
image

The problem was pretty simple, since we go through the ancestors we first try to expand the macro call node we are in since in attributed items these are valid syntaxnodes instead of TokenTrees, we then fail the expansion since the expansion only exists in the attribute expanded file and therefor skip the attribute expansion due to returning immediately. So instead of breaking out we just continue looking up the ancestors.

Fixes #10115
bors r+

@bors

bors Bot commented Sep 2, 2021

Copy link
Copy Markdown
Contributor

@bors bors Bot merged commit 796bfcc into rust-lang:master Sep 2, 2021
@Veykril Veykril deleted the descend branch September 2, 2021 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fn-like macros in attribute macros break IDE functionality

1 participant