-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable "jump to def" feature on rustc docs #136589
Enable "jump to def" feature on rustc docs #136589
Conversation
@@ -827,7 +827,7 @@ 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)] | |||
#[cfg(all(not(doc), debug_assertions))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code | ||
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue tracking getting rid of the cfged-out-code doc generating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I know of.
""Normally"" we're supposed to do that already. The HIR visitor might provide it though (which is why it failed in the past), would be interesting to check why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it might be that the cfg doc is not necessary? Can you test that? If it is necessary, please create a tracking issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cfg doc is necessary, otherwise I get:
error[E0433]: failed to resolve: could not resolve path `rustc_passes::hir_id_validator::check_crate`
--> compiler/rustc_interface/src/passes.rs:833:5
|
833 | rustc_passes::hir_id_validator::check_crate(tcx);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `rustc_passes::hir_id_validator::check_crate`
|
Opened #136604.
This comment has been minimized.
This comment has been minimized.
646d530
to
e58aa21
Compare
Fixed indent and added code comment. |
@bors r+ |
…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`
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`) - rust-lang#136193 (Implement pattern type ffi checks) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern) - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types) - rust-lang#136315 (Use short ty string for binop and unop errors) - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns) - rust-lang#136530 (Implement `x perf` directly in bootstrap) - rust-lang#136580 (Couple of changes to run rustc in miri) - rust-lang#136589 (Enable "jump to def" feature on rustc docs) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`) - rust-lang#136193 (Implement pattern type ffi checks) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern) - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types) - rust-lang#136315 (Use short ty string for binop and unop errors) - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns) - rust-lang#136530 (Implement `x perf` directly in bootstrap) - rust-lang#136580 (Couple of changes to run rustc in miri) - rust-lang#136589 (Enable "jump to def" feature on rustc docs) r? `@ghost` `@rustbot` modify labels: rollup
…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`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135179 (Make sure to use `Receiver` trait when extracting object method candidate) - rust-lang#136554 (Add `opt_alias_variances` and use it in outlives code) - rust-lang#136556 ([AIX] Update tests/ui/wait-forked-but-failed-child.rs to accomodate exiting and idle processes.) - rust-lang#136589 (Enable "jump to def" feature on rustc docs) - rust-lang#136615 (sys: net: Add UEFI stubs) - rust-lang#136635 (Remove outdated `base_port` calculation in std net test) - rust-lang#136682 (Move two windows process tests to tests/ui) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#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``
…,GuillaumeGomez Re-enable `--generate-link-to-defintion` for tools internal rustdoc ~~These were removed because they used to break the build: rust-lang#122066 (comment), but testing locally it seems to work now.~~ This was re enabled in rust-lang#136589, but only for rustc, not tools. The FIXME that prompted removing this is still present. Do we have an issue with an MCVE for this? CC `@GuillaumeGomez` https://github.com/rust-lang/rust/blob/ac91805f3179fc2225c60e8ccf5a1daa09d43f3d/src/librustdoc/html/render/span_map.rs#L178-L182 try-job: aarch64-apple
…,GuillaumeGomez Re-enable `--generate-link-to-defintion` for tools internal rustdoc ~~These were removed because they used to break the build: rust-lang#122066 (comment), but testing locally it seems to work now.~~ This was re enabled in rust-lang#136589, but only for rustc, not tools. The FIXME that prompted removing this is still present. Do we have an issue with an MCVE for this? CC ``@GuillaumeGomez`` https://github.com/rust-lang/rust/blob/ac91805f3179fc2225c60e8ccf5a1daa09d43f3d/src/librustdoc/html/render/span_map.rs#L178-L182 try-job: aarch64-apple
…,GuillaumeGomez Re-enable `--generate-link-to-defintion` for tools internal rustdoc ~~These were removed because they used to break the build: rust-lang#122066 (comment), but testing locally it seems to work now.~~ This was re enabled in rust-lang#136589, but only for rustc, not tools. The FIXME that prompted removing this is still present. Do we have an issue with an MCVE for this? CC ```@GuillaumeGomez``` https://github.com/rust-lang/rust/blob/ac91805f3179fc2225c60e8ccf5a1daa09d43f3d/src/librustdoc/html/render/span_map.rs#L178-L182 try-job: aarch64-apple
Rollup merge of rust-lang#137693 - aDotInTheVoid:gaming, r=onur-ozkan,GuillaumeGomez Re-enable `--generate-link-to-defintion` for tools internal rustdoc ~~These were removed because they used to break the build: rust-lang#122066 (comment), but testing locally it seems to work now.~~ This was re enabled in rust-lang#136589, but only for rustc, not tools. The FIXME that prompted removing this is still present. Do we have an issue with an MCVE for this? CC ```@GuillaumeGomez``` https://github.com/rust-lang/rust/blob/ac91805f3179fc2225c60e8ccf5a1daa09d43f3d/src/librustdoc/html/render/span_map.rs#L178-L182 try-job: aarch64-apple
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135179 (Make sure to use `Receiver` trait when extracting object method candidate) - rust-lang#136554 (Add `opt_alias_variances` and use it in outlives code) - rust-lang#136556 ([AIX] Update tests/ui/wait-forked-but-failed-child.rs to accomodate exiting and idle processes.) - rust-lang#136589 (Enable "jump to def" feature on rustc docs) - rust-lang#136615 (sys: net: Add UEFI stubs) - rust-lang#136635 (Remove outdated `base_port` calculation in std net test) - rust-lang#136682 (Move two windows process tests to tests/ui) r? `@ghost` `@rustbot` modify labels: rollup
This PR enables the rustdoc "jump to def" feature which is visible on the source code pages.
r? @oli-obk