Skip to content
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

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

GuillaumeGomez
Copy link
Member

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

r? @oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 5, 2025
@@ -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))]
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Comment on lines 831 to 832
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2025
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the enable-jump-to-def-compiler branch from 646d530 to e58aa21 Compare February 5, 2025 16:40
@GuillaumeGomez
Copy link
Member Author

Fixed indent and added code comment.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 5, 2025

@bors r+

@bors
Copy link
Contributor

bors commented Feb 5, 2025

📌 Commit e58aa21 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 6, 2025
…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`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
…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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 7, 2025
…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`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2025
…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
@bors bors merged commit 688fc9b into rust-lang:master Feb 8, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 8, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2025
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 GuillaumeGomez deleted the enable-jump-to-def-compiler branch February 10, 2025 09:39
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…,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
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…,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
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…,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
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2025
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
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants