Skip to content

Commit 936683c

Browse files
committed
Make crate AST mutation accessible for driver callback
1 parent a748148 commit 936683c

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)