about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-07 21:31:01 +0100
committerGitHub <noreply@github.com>2025-02-07 21:31:01 +0100
commit688fc9bd21798e2804bc9f29f50de48f520dad2a (patch)
treec6f840f4b171f2b9f0b80610ecdc27fefd840769 /compiler/rustc_interface/src
parent8aa6cfbe53577c0769874361bd647b54e12672b5 (diff)
parente58aa2105f3460c2da7aa747e7046a927d5cae7c (diff)
downloadrust-688fc9bd21798e2804bc9f29f50de48f520dad2a.tar.gz
rust-688fc9bd21798e2804bc9f29f50de48f520dad2a.zip
Rollup merge of #136589 - GuillaumeGomez:enable-jump-to-def-compiler, r=oli-obk
Enable "jump to def" feature on rustc docs

This PR enables the rustdoc "jump to def" feature which is visible on the source code pages.

r? ``@oli-obk``
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index eda9c4e03fe..e5adcdb244f 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -827,7 +827,9 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
     if tcx.sess.opts.unstable_opts.input_stats {
         rustc_passes::input_stats::print_hir_stats(tcx);
     }
-    #[cfg(debug_assertions)]
+    // When using rustdoc's "jump to def" feature, it enters this code and `check_crate`
+    // is not defined. So we need to cfg it out.
+    #[cfg(all(not(doc), debug_assertions))]
     rustc_passes::hir_id_validator::check_crate(tcx);
     let sess = tcx.sess;
     sess.time("misc_checking_1", || {