Skip to content

Commit 6f9e1a0

Browse files
committed
Fix interaction of --no-analysis and --emit dep-info
Closes #21130
1 parent 896cb36 commit 6f9e1a0

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

src/librustc_driver/driver.rs

+22
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ pub fn compile_input(sess: Session,
103103

104104
write_out_deps(&sess, input, &outputs, &id[]);
105105

106+
controller_entry_point!(after_write_deps,
107+
CompileState::state_after_write_deps(input,
108+
&sess,
109+
outdir,
110+
&ast_map,
111+
&id[]));
112+
106113
let arenas = ty::CtxtArenas::new();
107114
let analysis = phase_3_run_analysis_passes(sess,
108115
ast_map,
@@ -176,6 +183,7 @@ pub fn source_name(input: &Input) -> String {
176183
pub struct CompileController<'a> {
177184
pub after_parse: PhaseController<'a>,
178185
pub after_expand: PhaseController<'a>,
186+
pub after_write_deps: PhaseController<'a>,
179187
pub after_analysis: PhaseController<'a>,
180188
pub after_llvm: PhaseController<'a>,
181189

@@ -187,6 +195,7 @@ impl<'a> CompileController<'a> {
187195
CompileController {
188196
after_parse: PhaseController::basic(),
189197
after_expand: PhaseController::basic(),
198+
after_write_deps: PhaseController::basic(),
190199
after_analysis: PhaseController::basic(),
191200
after_llvm: PhaseController::basic(),
192201
make_glob_map: resolve::MakeGlobMap::No,
@@ -271,6 +280,19 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
271280
}
272281
}
273282

283+
fn state_after_write_deps(input: &'a Input,
284+
session: &'a Session,
285+
out_dir: &'a Option<Path>,
286+
ast_map: &'a ast_map::Map<'ast>,
287+
crate_name: &'a str)
288+
-> CompileState<'a, 'ast, 'tcx> {
289+
CompileState {
290+
crate_name: Some(crate_name),
291+
ast_map: Some(ast_map),
292+
.. CompileState::empty(input, session, out_dir)
293+
}
294+
}
295+
274296
fn state_after_analysis(input: &'a Input,
275297
session: &'a Session,
276298
out_dir: &'a Option<Path>,

src/librustc_driver/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn build_controller<'a>(sess: &Session) -> CompileController<'a> {
207207
}
208208

209209
if sess.opts.no_analysis || sess.opts.debugging_opts.ast_json {
210-
control.after_expand.stop = true;
210+
control.after_write_deps.stop = true;
211211
}
212212

213213
if sess.opts.no_trans {

src/librustc_driver/mod.rs

-10
This file was deleted.

0 commit comments

Comments
 (0)