about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-29 15:29:51 +0100
committerGitHub <noreply@github.com>2025-01-29 15:29:51 +0100
commitc941b1c5fc59a0fe4cfbf8867bc820bada06d21d (patch)
tree71ab48ac1ab51a76833e66d21da5bde6e5906f46 /src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
parent1f6a9aaceed0790150de83c37692fe5b5dc4c7fe (diff)
parent5dfe0f8cf49110491ec0391c4b94b56834d65aef (diff)
downloadrust-c941b1c5fc59a0fe4cfbf8867bc820bada06d21d.tar.gz
rust-c941b1c5fc59a0fe4cfbf8867bc820bada06d21d.zip
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.
Diffstat (limited to 'src/doc/rustc-dev-guide/examples/rustc-driver-example.rs')
-rw-r--r--src/doc/rustc-dev-guide/examples/rustc-driver-example.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
index 8983915d78a..b0f9af1b8d1 100644
--- a/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
+++ b/src/doc/rustc-dev-guide/examples/rustc-driver-example.rs
@@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
     fn after_crate_root_parsing(
         &mut self,
         _compiler: &Compiler,
-        krate: &rustc_ast::Crate,
+        krate: &mut rustc_ast::Crate,
     ) -> Compilation {
         for item in &krate.items {
             println!("{}", item_to_string(&item));