File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 9
9
// except according to those terms.
10
10
11
11
#![ feature( doc_cfg) ]
12
+ #![ feature( target_feature, cfg_target_feature) ]
12
13
13
14
// @has doc_cfg/struct.Portable.html
14
15
// @!has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' ''
@@ -45,3 +46,26 @@ pub mod unix_only {
45
46
fn unix_and_arm_only_function ( ) { }
46
47
}
47
48
}
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