about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIgor Matuszewski <Xanewok@gmail.com>2019-07-14 20:24:48 +0200
committerIgor Matuszewski <Xanewok@gmail.com>2019-07-15 16:53:18 +0200
commitae75311823574fd697f28961cecb0e0f3f3382ce (patch)
treeabf9c3dd59507b888128e9ece2f5f3d127c70e5c
parent85a360e0ea2f1629b8851e7c9b2903bbdbab42bf (diff)
Add Callbacks::after_expansion
-rw-r--r--src/librustc_driver/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index e615f8a4846..8f69171cb4e 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -109,6 +109,10 @@ pub trait Callbacks {
     fn after_parsing(&mut self, _compiler: &interface::Compiler) -> bool {
         true
     }
+    /// Called after expansion and returns true to continue execution
+    fn after_expansion(&mut self, _compiler: &interface::Compiler) -> bool {
+        true
+    }
     /// Called after analysis and returns true to continue execution
     fn after_analysis(&mut self, _compiler: &interface::Compiler) -> bool {
         true
@@ -312,6 +316,11 @@ pub fn run_compiler(
             return sess.compile_status();
         }
 
+        compiler.expansion()?;
+        if !callbacks.after_expansion(compiler) {
+            return sess.compile_status();
+        }
+
         compiler.prepare_outputs()?;
 
         if sess.opts.output_types.contains_key(&OutputType::DepInfo)