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

Inline the core::arch documentation into std #82861

Closed
wants to merge 1 commit into from

Conversation

jfrimmel
Copy link
Contributor

@jfrimmel jfrimmel commented Mar 7, 2021

This PR removes the #[doc(no_inline)]-attribute from the pub use statement of the core::arch-module. This has the effect, that the module is not listed under the re-exported section in the documentation (it is the only item in a re-exports-section in the std), but as a normal module.

This also removes the only mention of the core-crate in the std crate, which is desirable, as only a subset of Rust users know core and its relationship with the std.

The git history did not reveal, why this was added in the first place. If there is a reason, I can close this PR 😉

This commit removes the `#[doc(no_inline)]`-attribute from the `pub use`
statement of the `core::arch`-module. This has the effect, that the
module is not listed under the re-exported section in the documentation
(it is the only item in a re-exports-section in the `std`), but as a
normal module.
This also removes the only mention of the `core`-crate in the `std`
crate, which is desirable, as only a subset of Rust users know `core`
and its relationship with the `std`.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 7, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 9300/11531
.................................................................................................... 9400/11531
.......................................................................i......i..................... 9500/11531
.................................................................................................... 9600/11531
..........iiiiiii..iiiiii.i......................................................................... 9700/11531
.................................................................................................... 9900/11531
.................................................................................................... 10000/11531
.................................................................................................... 10100/11531
.................................................................................................... 10200/11531
---
Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 29 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiii

 finished in 0.051 seconds
Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 116 tests
iiiiiiiiii.i.i..i..i..ii....i.i....ii..........iiii.........i.....i...i.......ii.i.ii.....iiii.....i 100/116
test result: ok. 78 passed; 0 failed; 38 ignored; 0 measured; 0 filtered out; finished in 1.85s

Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
 finished in 1.907 seconds
---
Building stage0 tool linkchecker (x86_64-unknown-linux-gnu)
   Compiling once_cell v1.4.1
   Compiling linkchecker v0.1.0 (/checkout/src/tools/linkchecker)
    Finished release [optimized] target(s) in 1.38s
std/arch/index.html:154: broken link - std/arch/x86/index.html
std/arch/index.html:156: broken link - std/arch/arm/index.html
std/arch/index.html:157: broken link - std/arch/aarch64/index.html
std/arch/index.html:158: broken link - std/arch/mips/index.html
std/arch/index.html:159: broken link - std/arch/mips64/index.html
std/arch/index.html:160: broken link - std/arch/powerpc/index.html
std/arch/index.html:161: broken link - std/arch/powerpc64/index.html
std/arch/index.html:162: broken link - std/arch/nvptx/index.html
std/arch/index.html:163: broken link - std/arch/wasm32/index.html
thread 'main' panicked at 'found some broken links', src/tools/linkchecker/main.rs:102:9


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
expected success, got: exit code: 101

@jfrimmel
Copy link
Contributor Author

jfrimmel commented Mar 7, 2021

Hm, I'm unsure about this test failure. Maybe this is the cause for the re-export in the first place...

@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

The git history did not reveal, why this was added in the first place. If there is a reason, I can close this PR wink
Hm, I'm unsure about this test failure. Maybe this is the cause for the re-export in the first place...

#57808 (comment):

I chatted with @gnzlbg on Discord and realized what was going on. When rustdoc is generating docs for libstd, it needs to link against a compiled version of libcore. Since only rustdoc sets cfg(rustdoc), the compiled version of libcore that libstd links against only has the core::arch information for the target's arch. This is why the std::arch page is missing most of its submodules - even though it's re-exporting the module directly from libcore, the libcore that it sees is the one that only has the target's arch available. The version with all the arches specified only exists while rustdoc is running, and it doesn't generate anything that libstd can use to create its own docs.

So this won't work without substantial changes to rustdoc or how core is compiled.

@jyn514 jyn514 closed this Mar 7, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

If you want to add a comment saying why doc(no_inline) is there, that would be helpful, though :)

@jfrimmel
Copy link
Contributor Author

jfrimmel commented Mar 7, 2021

I could not re-open this PR, so I opened a new one for the comment: #82870.

@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

I could not re-open this PR, so I opened a new one for the comment: #82870.

Thanks. Sorry, I didn't realize github doesn't let you reopen your own PR.

m-ou-se added a commit to m-ou-se/rust that referenced this pull request Mar 8, 2021
Add note about the `#[doc(no-inline)]` usage

This is required to correctly build the documentation (including all submodules, that are only available in certain targets).

See the linked issue and rust-lang#82861 for reference.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants