Skip to content

Commit ae75311

Browse files
committed
Add Callbacks::after_expansion
1 parent 85a360e commit ae75311

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc_driver/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ pub trait Callbacks {
109109
fn after_parsing(&mut self, _compiler: &interface::Compiler) -> bool {
110110
true
111111
}
112+
/// Called after expansion and returns true to continue execution
113+
fn after_expansion(&mut self, _compiler: &interface::Compiler) -> bool {
114+
true
115+
}
112116
/// Called after analysis and returns true to continue execution
113117
fn after_analysis(&mut self, _compiler: &interface::Compiler) -> bool {
114118
true
@@ -312,6 +316,11 @@ pub fn run_compiler(
312316
return sess.compile_status();
313317
}
314318

319+
compiler.expansion()?;
320+
if !callbacks.after_expansion(compiler) {
321+
return sess.compile_status();
322+
}
323+
315324
compiler.prepare_outputs()?;
316325

317326
if sess.opts.output_types.contains_key(&OutputType::DepInfo)

0 commit comments

Comments
 (0)