Skip to content

Commit c90e854

Browse files
committed
Rollup merge of rust-lang#22614 - nick29581:fix-cc-crate, r=alexcrichton
... the post-analysis callback. We can also pass this to post-write-deps callback. This fixes a really minor bug, which is basically about argument naming. r? @alexcrichton
2 parents 9fd4551 + 712a687 commit c90e854

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/librustc_driver/driver.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub fn compile_input(sess: Session,
112112
&sess,
113113
outdir,
114114
&ast_map,
115+
&ast_map.krate(),
115116
&id[..]));
116117

117118
let analysis = phase_3_run_analysis_passes(sess,
@@ -287,26 +288,28 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
287288
session: &'a Session,
288289
out_dir: &'a Option<Path>,
289290
ast_map: &'a ast_map::Map<'ast>,
291+
expanded_crate: &'a ast::Crate,
290292
crate_name: &'a str)
291293
-> CompileState<'a, 'ast, 'tcx> {
292294
CompileState {
293295
crate_name: Some(crate_name),
294296
ast_map: Some(ast_map),
297+
expanded_crate: Some(expanded_crate),
295298
.. CompileState::empty(input, session, out_dir)
296299
}
297300
}
298301

299302
fn state_after_analysis(input: &'a Input,
300303
session: &'a Session,
301304
out_dir: &'a Option<Path>,
302-
krate: &'a ast::Crate,
305+
expanded_crate: &'a ast::Crate,
303306
analysis: &'a ty::CrateAnalysis<'tcx>,
304307
tcx: &'a ty::ctxt<'tcx>)
305308
-> CompileState<'a, 'ast, 'tcx> {
306309
CompileState {
307310
analysis: Some(analysis),
308311
tcx: Some(tcx),
309-
krate: Some(krate),
312+
expanded_crate: Some(expanded_crate),
310313
.. CompileState::empty(input, session, out_dir)
311314
}
312315
}

src/librustc_driver/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,13 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
373373

374374
if sess.opts.debugging_opts.save_analysis {
375375
control.after_analysis.callback = box |state| {
376-
time(state.session.time_passes(), "save analysis", state.krate.unwrap(), |krate|
377-
save::process_crate(state.session,
378-
krate,
379-
state.analysis.unwrap(),
380-
state.out_dir));
376+
time(state.session.time_passes(),
377+
"save analysis",
378+
state.expanded_crate.unwrap(),
379+
|krate| save::process_crate(state.session,
380+
krate,
381+
state.analysis.unwrap(),
382+
state.out_dir));
381383
};
382384
control.make_glob_map = resolve::MakeGlobMap::Yes;
383385
}

0 commit comments

Comments
 (0)