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.
You are calling
queries.global_ctxt()
from within it, which makes rustc_driver skip some code that should run before you access theTyCtxt
. I would like to either remove this function in the future or change it to only allow access to the AST and not to theTyCtxt
. Using theafter_analysis
or (if you need to avoidtcx.analysis()
) theafter_expansion
callbacks should work better.Edit: https://github.com/rust-lang/rust/pull/132410 will mark it as deprecated.