Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8236f63

Browse files
committedAug 6, 2023
Auto merge of #114476 - Urgau:missing-dep-file-112898, r=oli-obk
Fix missing dependency file with `-Zunpretty` This PR force the `output_filenames` to be run ~~in every early exits like~~ when using `-Zunpretty`, so to respect the `dep-info` flag. Fixes #112898 r? `@oli-obk`
2 parents eb088b8 + 8229d8e commit 8236f63

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
@@ -391,6 +391,10 @@ fn run_compiler(
391391
pretty::print_after_hir_lowering(tcx, *ppm);
392392
Ok(())
393393
})?;
394+
395+
// Make sure the `output_filenames` query is run for its side
396+
// effects of writing the dep-info and reporting errors.
397+
queries.global_ctxt()?.enter(|tcx| tcx.output_filenames(()));
394398
} else {
395399
let krate = queries.parse()?.steal();
396400
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)
Failed to load comments.