Skip to content

Commit 71c2f19

Browse files
authored
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.
2 parents 7049f66 + 936683c commit 71c2f19

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/rustc-driver-example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
5858
fn after_crate_root_parsing(
5959
&mut self,
6060
_compiler: &Compiler,
61-
krate: &rustc_ast::Crate,
61+
krate: &mut rustc_ast::Crate,
6262
) -> Compilation {
6363
for item in &krate.items {
6464
println!("{}", item_to_string(&item));

examples/rustc-driver-interacting-with-the-ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
5858
fn after_crate_root_parsing(
5959
&mut self,
6060
_compiler: &Compiler,
61-
krate: &rustc_ast::Crate,
61+
krate: &mut rustc_ast::Crate,
6262
) -> Compilation {
6363
for item in &krate.items {
6464
println!("{}", item_to_string(&item));

0 commit comments

Comments
 (0)