File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 99// except according to those terms.
1010
1111#![ feature( doc_cfg) ]
12+ #![ feature( target_feature, cfg_target_feature) ]
1213
1314// @has doc_cfg/struct.Portable.html
1415// @!has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' ''
@@ -45,3 +46,26 @@ pub mod unix_only {
4546 fn unix_and_arm_only_function ( ) { }
4647 }
4748}
49+
50+ // tagging a function with `#[target_feature]` creates a doc(cfg(target_feature)) node for that
51+ // item as well
52+
53+ // the portability header is different on the module view versus the full view
54+ // @has doc_cfg/index.html
55+ // @matches - '//*[@class=" module-item"]//*[@class="stab portability"]' '\Aavx\Z'
56+
57+ // @has doc_cfg/fn.uses_target_feature.html
58+ // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
59+ // 'This is supported with target feature avx only.'
60+ #[ target_feature( enable = "avx" ) ]
61+ pub unsafe fn uses_target_feature ( ) {
62+ content:: should:: be:: irrelevant ( ) ;
63+ }
64+
65+ // @has doc_cfg/fn.uses_cfg_target_feature.html
66+ // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
67+ // 'This is supported with target feature avx only.'
68+ #[ doc( cfg( target_feature = "avx" ) ) ]
69+ pub fn uses_cfg_target_feature ( ) {
70+ uses_target_feature ( ) ;
71+ }
You can’t perform that action at this time.
0 commit comments