rust/compiler/rustc_driver_impl/src
Matthias Krüger af1ca153d4
Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillot
Some more refactorings towards removing driver queries

Follow up to https://github.com/rust-lang/rust/pull/127184

## Custom driver breaking change

The `after_analysis` callback is changed to accept `TyCtxt` instead of `Queries`. The only safe query in `Queries` to call at this point is `global_ctxt()` which allows you to enter the `TyCtxt` either way. To fix your custom driver, replace the `queries: &'tcx Queries<'tcx>` argument with `tcx: TyCtxt<'tcx>` and remove your `queries.global_ctxt().unwrap().enter(|tcx| { ... })` call and only keep the contents of the closure.

## Custom driver deprecation

The `after_crate_root_parsing` callback is now deprecated. Several custom drivers are incorrectly calling `queries.global_ctxt()` from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an `&rustc_ast::Crate` instead.
2024-11-27 22:23:24 +01:00
..
args.rs Refactor argument UTF-8 checking into rustc_driver::args::raw_args() 2024-03-07 00:20:01 +00:00
lib.rs Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillot 2024-11-27 22:23:24 +01:00
pretty.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
print.rs Fix ICE on --print=... i/o errors 2023-04-25 08:17:18 -07:00
session_diagnostics.rs unstable feature usage metrics 2024-11-20 11:31:40 -08:00
signal_handler.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00