about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-03-22 17:51:16 +0800
committerGitHub <noreply@github.com>2018-03-22 17:51:16 +0800
commitd67084215d0b0d534104fc2957e7ced3f4d922a9 (patch)
tree0707b271d68a805fca497b94c511175920d23869 /src/rustllvm/RustWrapper.cpp
parenta848336a316e0c19c010644d9942bd5ac8794834 (diff)
parentb3fb0d10f03fe7d8f2eaa705a972b0f45e1723db (diff)
downloadrust-d67084215d0b0d534104fc2957e7ced3f4d922a9.tar.gz
rust-d67084215d0b0d534104fc2957e7ced3f4d922a9.zip
Rollup merge of #48759 - QuietMisdreavus:simd-feature-docs, r=GuillaumeGomez
rustdoc: expose #[target_feature] attributes as doc(cfg) flags

This change exposes `#[target_feature(enable = "feat")]` attributes on an item as if they were also `#[doc(cfg(target_feature = "feat"))]` attributes. This gives them a banner on their documentation listing which feature is required to use the item. It also modifies the rendering code for doc(cfg) tags to handle `target_feature` tags. I made it print just the feature name on "short" printings (as in the function listing on a module page), and use "target feature `feat`" in the full banner on the item page itself.

This way, the function listing in `std::arch` shows which feature is required for each function:

![image](https://user-images.githubusercontent.com/5217170/37003222-f41b9d66-2091-11e8-9656-8719e5b34832.png)

![image](https://user-images.githubusercontent.com/5217170/37003234-feb1a7a2-2091-11e8-94de-6d1d76a2d3ee.png)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions