Skip to content

Fix panic on eager expansion #3429

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

Merged
merged 2 commits into from
Mar 4, 2020
Merged

Conversation

edwin0cheng
Copy link
Member

When lazy expanding inside an eager macro, its parent file of that lazy macro call must be already exists such that a panic is occurred because that parent file is the eager macro we are processing.

This PR fix this bug by store the argument syntax node as another eager macro id for that purpose.

Personally I don't know if it is a good answer for this bug.

@kjeremy
Copy link
Contributor

kjeremy commented Mar 3, 2020

Is this the panic below?

thread '' panicked at 'Can't find MACRO_CALL@[125; 139) in AstIdMap:
[SyntaxNodePtr { range: [6; 203), kind: MACRO_CALL }, SyntaxNodePtr { range: [204; 420), kind: FN_DEF }]', crates\ra_hir_expand\src\ast_id_map.rs:88:21

@edwin0cheng
Copy link
Member Author

@kjeremy yes

@matklad
Copy link
Member

matklad commented Mar 4, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 4, 2020

@bors bors bot merged commit 437329d into rust-lang:master Mar 4, 2020
@edwin0cheng edwin0cheng deleted the fix-panic-eager branch March 4, 2020 02:02
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
De-duplicate SSE2 sll/srl/sra code
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.

3 participants