verus-lang / verus

Verified Rust for low-level systems code
MIT License
1.22k stars 71 forks source link

Please avoid the after_crate_root_parsing driver callback #1331

Open bjorn3 opened 1 week ago

bjorn3 commented 1 week ago

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.

https://github.com/rust-lang/rust/pull/132410 will mark it as deprecated.

utaal commented 1 week ago

Thank you @bjorn3 for the heads up, we'll try and move away from it soon.