-
Notifications
You must be signed in to change notification settings - Fork 14k
std-detect: improve detect macro docs #147586
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
Conversation
document that the detect macros expand to `true` when the feature is statically enabled
1a4a700 to
bc911c2
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| /// ## Supported arguments | ||
| /// | ||
| /// * `"aes"` - FEAT_AES & FEAT_PMULL |
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.
does this list add anything? most of the information is in the doc comments on the individual features already. Only loongarch also has such a list, the other targets don't bother.
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.
I'm not sure, this list was originally added by @adamgemmell.
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 mapping from feature names to proper hardware features is useful - I'd argue the doc comments on the individual features aren't actually needed as they don't show up in the rendered docs (https://doc.rust-lang.org/nightly/std/arch/macro.is_aarch64_feature_detected.html) - if I recall correctly they end up documenting a private struct. Both x86 and risc-v also provide a list of supported arguments (though the x86 ones don't list any extra information than is already available from how rustdoc renders the macro definition)
|
@bors r+ rollup |
Rollup of 7 pull requests Successful merges: - #145656 (Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro) - #147043 (Add default sanitizers to TargetOptions) - #147803 (Add -Zannotate-moves for profiler visibility of move/copy operations (codegen)) - #147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests) - #148540 (Minor fixes to StdNonZeroNumberProvider for gdb) - #148541 (Add num_children method to some gdb pretty-printers) - #148549 (Fix broken qemu-cskyv2 link) Failed merges: - #147586 (std-detect: improve detect macro docs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 7 pull requests Successful merges: - #143037 (Make named asm_labels lint not trigger on hexagon register spans) - #147043 (Add default sanitizers to TargetOptions) - #147586 (std-detect: improve detect macro docs) - #147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests) - #148540 (Minor fixes to StdNonZeroNumberProvider for gdb) - #148541 (Add num_children method to some gdb pretty-printers) - #148549 (Fix broken qemu-cskyv2 link) Failed merges: - #147935 (Add LLVM realtime sanitizer) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147586 - folkertdev:std-detect-expands-to-true, r=Amanieu std-detect: improve detect macro docs Specifically, document that the detect macros expand to `true` when the feature is statically enabled. Now that we have a bunch of these macros, perhaps we should streamline further how they are documented? r? ``@Amanieu``
Specifically, document that the detect macros expand to
truewhen the feature is statically enabled.Now that we have a bunch of these macros, perhaps we should streamline further how they are documented?
r? @Amanieu