Rollup merge of #136214 - momvart:driver_callback_crate_mut, r=bjorn3

Make crate AST mutation accessible for driver callback

Following  #134130, this brings back the ability to mutate AST before lowering.
This commit is contained in:
Matthias Krüger 2025-01-29 15:29:51 +01:00 committed by GitHub
commit 71c2f1924b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
fn after_crate_root_parsing( fn after_crate_root_parsing(
&mut self, &mut self,
_compiler: &Compiler, _compiler: &Compiler,
krate: &rustc_ast::Crate, krate: &mut rustc_ast::Crate,
) -> Compilation { ) -> Compilation {
for item in &krate.items { for item in &krate.items {
println!("{}", item_to_string(&item)); println!("{}", item_to_string(&item));

View File

@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
fn after_crate_root_parsing( fn after_crate_root_parsing(
&mut self, &mut self,
_compiler: &Compiler, _compiler: &Compiler,
krate: &rustc_ast::Crate, krate: &mut rustc_ast::Crate,
) -> Compilation { ) -> Compilation {
for item in &krate.items { for item in &krate.items {
println!("{}", item_to_string(&item)); println!("{}", item_to_string(&item));