diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-11 09:31:43 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-13 06:35:19 +1100 |
| commit | b65227a9ee38cd21e0b4ffbec7542d2638b661a2 (patch) | |
| tree | 9931ee46adc43ce43dd2e1159563c8556b9c381c | |
| parent | ba58e3213db9626381f5fd014e569f7d2335fa03 (diff) | |
| download | rust-b65227a9ee38cd21e0b4ffbec7542d2638b661a2.tar.gz rust-b65227a9ee38cd21e0b4ffbec7542d2638b661a2.zip | |
Make `needs_analysis` true for `PpHirMode::Typed`.
This avoids the need for a bespoke `tcx.analysis()` call.
| -rw-r--r-- | compiler/rustc_driver_impl/src/pretty.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_driver_impl/src/pretty.rs b/compiler/rustc_driver_impl/src/pretty.rs index daba78612f5..87e3af2f9d9 100644 --- a/compiler/rustc_driver_impl/src/pretty.rs +++ b/compiler/rustc_driver_impl/src/pretty.rs @@ -297,7 +297,6 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) { f(&annotation) } PpHirMode::Typed => { - abort_on_err(tcx.analysis(()), tcx.sess); let annotation = TypedAnnotation { tcx, maybe_typeck_results: Cell::new(None) }; tcx.dep_graph.with_ignore(|| f(&annotation)) } diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 056986a8144..2a6f5994c49 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -3144,7 +3144,7 @@ impl PpMode { pub fn needs_analysis(&self) -> bool { use PpMode::*; - matches!(*self, Mir | MirCFG | ThirTree | ThirFlat) + matches!(*self, Hir(PpHirMode::Typed) | Mir | MirCFG | ThirTree | ThirFlat) } } |
