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

Please avoid the after_crate_root_parsing driver callback #449

Closed
bjorn3 opened this issue Oct 31, 2024 · 1 comment · Fixed by #453
Closed

Please avoid the after_crate_root_parsing driver callback #449

bjorn3 opened this issue Oct 31, 2024 · 1 comment · Fixed by #453
Assignees

Comments

@bjorn3
Copy link

bjorn3 commented Oct 31, 2024

You are calling queries.global_ctxt() from within it, which makes rustc_driver skip some code that should run before you access the TyCtxt. I would like to either remove this function in the future or change it to only allow access to the AST and not to the TyCtxt. Using the after_analysis or (if you need to avoid tcx.analysis()) the after_expansion callbacks should work better.

rust-lang/rust#132410 will mark it as deprecated.

@Nadrieril
Copy link
Member

Hay, thanks for the heads up! I was avoiding after_analysis for MIR stealing reasons, I'll just use after_expansion.

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 a pull request may close this issue.

2 participants