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

document all arches when part of std #367

Merged
merged 2 commits into from
Mar 9, 2018

Conversation

QuietMisdreavus
Copy link
Member

This PR adds the doc_cfg feature to coresimd and stdsimd to tell rustdoc about which arch is required for each module. It also uses the #[cfg(dox)] configuration flag that the rest of libstd uses to ensure that all four major arch modules are included when rustdoc builds the library. This worked great for coresimd, which now proudly shows all the arch intrinsics. However, when trying to re-export these modules in stdsimd, the cfg(dox) trick doesn't work any more, so instead we mask out these modules and link to libcore. Rather than show the full docs for whatever the native arch of the build environment was, i masked out all of them and stubbed them out.

For a preview, i have a rendering on my server. Here's what the modules listing looks like in std::arch when this branch is used as part of the std docs:

every arch? in this part of the docs? localized entirely on my server? may i see it?

unfortunately, stdsimd's version of the documentation will be blanked
out in favor of coresimd's version, but coresimd (when re-exported in
libcore) will include all the arches
@gnzlbg gnzlbg merged commit bcb720e into rust-lang:master Mar 9, 2018
@gnzlbg
Copy link
Contributor

gnzlbg commented Mar 9, 2018

Thanks!

@QuietMisdreavus QuietMisdreavus deleted the doc-cfg branch March 9, 2018 23:04
kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018
…l-the-time, r=alexcrichton

whitelist every target feature for rustdoc

When rust-lang/stdarch#367 was attempted to be upstreamed, it failed to document on non-x86 targets because it made every intrinsic visible, even the ones on foreign arches. This change makes it so that whenever rustdoc asks for the target feature whitelist, it gets a list of every feature known to every arch in `rustc_trans/llvm_util.rs`.

Before pushing, i temporarily updated the `stdsimd` submodule to include the `doc(cfg)` change, generated documentation for `aarch64-unknown-linux-gnu`, and it completed without a problem. The generated `core::arch` docs contained complete submodules for all main arches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants