diff options
| author | Mohammad Omidvar <m_omidvart@sfu.ca> | 2025-01-28 19:45:20 +0000 |
|---|---|---|
| committer | Mohammad Omidvar <m_omidvart@sfu.ca> | 2025-01-28 19:45:20 +0000 |
| commit | 5dfe0f8cf49110491ec0391c4b94b56834d65aef (patch) | |
| tree | adec6111ec144abf63fe0233ee90f7acabaa7da4 /compiler/rustc_driver_impl/src | |
| parent | fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0 (diff) | |
| download | rust-5dfe0f8cf49110491ec0391c4b94b56834d65aef.tar.gz rust-5dfe0f8cf49110491ec0391c4b94b56834d65aef.zip | |
Make crate AST mutation accessible for driver callback
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 20be2144609..c9d38a0f932 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -160,7 +160,7 @@ pub trait Callbacks { fn after_crate_root_parsing( &mut self, _compiler: &interface::Compiler, - _queries: &ast::Crate, + _krate: &mut ast::Crate, ) -> Compilation { Compilation::Continue } @@ -311,7 +311,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send)) // Parse the crate root source code (doesn't parse submodules yet) // Everything else is parsed during macro expansion. - let krate = passes::parse(sess); + let mut krate = passes::parse(sess); // If pretty printing is requested: Figure out the representation, print it and exit if let Some(pp_mode) = sess.opts.pretty { @@ -328,7 +328,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send)) return early_exit(); } - if callbacks.after_crate_root_parsing(compiler, &krate) == Compilation::Stop { + if callbacks.after_crate_root_parsing(compiler, &mut krate) == Compilation::Stop { return early_exit(); } |
