Skip to content

Commit b65227a

Browse files
committed
Make needs_analysis true for PpHirMode::Typed.
This avoids the need for a bespoke `tcx.analysis()` call.
1 parent ba58e32 commit b65227a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Diff for: compiler/rustc_driver_impl/src/pretty.rs

-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
297297
f(&annotation)
298298
}
299299
PpHirMode::Typed => {
300-
abort_on_err(tcx.analysis(()), tcx.sess);
301300
let annotation = TypedAnnotation { tcx, maybe_typeck_results: Cell::new(None) };
302301
tcx.dep_graph.with_ignore(|| f(&annotation))
303302
}

Diff for: compiler/rustc_session/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3144,7 +3144,7 @@ impl PpMode {
31443144

31453145
pub fn needs_analysis(&self) -> bool {
31463146
use PpMode::*;
3147-
matches!(*self, Mir | MirCFG | ThirTree | ThirFlat)
3147+
matches!(*self, Hir(PpHirMode::Typed) | Mir | MirCFG | ThirTree | ThirFlat)
31483148
}
31493149
}
31503150

0 commit comments

Comments
 (0)