-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
base: master
Are you sure you want to change the base?
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+ |
This PR enables the rustdoc "jump to def" feature which is visible on the source code pages.
r? @oli-obk