Skip to content

Conversation

pierwill
Copy link
Contributor

@pierwill pierwill commented Feb 19, 2022

This helps some IDE's open the rustc API docs at https://doc.rust-lang.org/nightly/nightly-rustc.

The consensus was against this change in #91810. However, about half of the rustc crates already use this attribute (which was not mentioned in that discussion):

$ cd rust/compiler/
$ ls | wc -l
61
$ rg html_root_url --stats
rustc_apfloat/src/lib.rs:33:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_arena/src/lib.rs:11:5:html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
rustc_ast/src/lib.rs:8:5:html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
rustc_builtin_macros/src/lib.rs:4:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_codegen_llvm/src/lib.rs:7:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_codegen_ssa/src/lib.rs:1:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_data_structures/src/lib.rs:9:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_driver/src/lib.rs:7:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_errors/src/lib.rs:5:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_graphviz/src/lib.rs:275:5:html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
rustc_incremental/src/lib.rs:4:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_infer/src/lib.rs:15:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_lint/src/lib.rs:28:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_llvm/src/lib.rs:3:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_metadata/src/lib.rs:1:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_middle/src/lib.rs:25:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_parse_format/src/lib.rs:8:5:html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
rustc_passes/src/check_attr.rs:962:32:| sym::html_root_url
rustc_passes/src/check_attr.rs:993:32:| sym::html_root_url
rustc_passes/src/lib.rs:7:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_plugin_impl/src/lib.rs:9:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_privacy/src/lib.rs:1:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_query_impl/src/lib.rs:3:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_resolve/src/lib.rs:11:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_save_analysis/src/lib.rs:1:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_serialize/src/lib.rs:8:5:html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
rustc_span/src/lib.rs:16:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_span/src/symbol.rs:740:9:html_root_url,
rustc_symbol_mangling/src/lib.rs:90:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_target/src/lib.rs:10:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_trait_selection/src/lib.rs:13:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_ty_utils/src/lib.rs:7:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
rustc_typeck/src/lib.rs:58:8:#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]

33 matches

I'd also be in favor of adding this to all rustc_* crates.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 19, 2022
@rust-highfive
Copy link
Contributor

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2022
@Mark-Simulacrum
Copy link
Member

IMO it is still the case that this attribute should not be present in our crate source code -- I think the current scattering of these likely derives from copy/pasting headers from a few sources originally, but that is not really strong motivation for propagating that outwards to more crates.

Ideally, users can configure their editors to specify the correct html-root-url if they're depending on them to provide some kind of links.

@pierwill
Copy link
Contributor Author

Makes sense.

@pierwill pierwill closed this Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

5 participants