Skip to content
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

Store invocation site for eager macros #7000

Merged
merged 1 commit into from
Dec 23, 2020
Merged

Store invocation site for eager macros #7000

merged 1 commit into from
Dec 23, 2020

Conversation

jonas-schievink
Copy link
Contributor

Fixes #6992

r? @edwin0cheng

I'm not sure if this is totally correct, it looks like we create two EagerCallLocs per macro invocation, one for the arguments (?), and one for the actual macro call. I gave both the same AstId, hopefully that's correct.

@edwin0cheng
Copy link
Member

edwin0cheng commented Dec 23, 2020

we create two EagerCallLocs per macro invocation, one for the arguments

IIRC, it is because eager macro can be chained (e.g. include!(concat!(..., ..)))) and we cannot alloc new MacroCallID here because we do not alloc to do that in item collection phase. (But actual reason I forgot :( )

LGTM

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 23, 2020

@bors bors bot merged commit 493e29d into rust-lang:master Dec 23, 2020
@jonas-schievink jonas-schievink deleted the eager-macro-call-loc branch December 23, 2020 09:01
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.

panic when using 'go to definition' on include!d file
2 participants