Skip to content

Commit 8229d8e

Browse files
committed
Fix missing dependency file with -Zunpretty
1 parent c435af0 commit 8229d8e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

compiler/rustc_driver_impl/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ fn run_compiler(
393393
pretty::print_after_hir_lowering(tcx, *ppm);
394394
Ok(())
395395
})?;
396+
397+
// Make sure the `output_filenames` query is run for its side
398+
// effects of writing the dep-info and reporting errors.
399+
queries.global_ctxt()?.enter(|tcx| tcx.output_filenames(()));
396400
} else {
397401
let krate = queries.parse()?.steal();
398402
pretty::print_after_parsing(sess, &krate, *ppm);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include ../tools.mk
2+
3+
all:
4+
$(RUSTC) --emit=dep-info -Zunpretty=expanded with-dep.rs
5+
$(CGREP) "with-dep.rs" < $(TMPDIR)/with-dep.d
6+
-rm $(TMPDIR)/with-dep.d
7+
8+
$(RUSTC) --emit=dep-info -Zunpretty=normal with-dep.rs
9+
! test -f $(TMPDIR)/with-dep.d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn main() {}

0 commit comments

Comments
 (0)