2 #![feature(target_feature, cfg_target_feature)]
4 // @has doc_cfg/struct.Portable.html
5 // @!has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' ''
6 // @has - '//*[@id="method.unix_and_arm_only_function"]' 'fn unix_and_arm_only_function()'
7 // @has - '//*[@class="stab portability"]' 'This is supported on Unix and ARM only.'
10 // @has doc_cfg/unix_only/index.html \
11 // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
12 // 'This is supported on Unix only.'
13 // @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\AUnix\Z'
14 // @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\AUnix and ARM\Z'
15 // @count - '//*[@class="stab portability"]' 3
18 // @has doc_cfg/unix_only/fn.unix_only_function.html \
19 // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
20 // 'This is supported on Unix only.'
21 // @count - '//*[@class="stab portability"]' 1
22 pub fn unix_only_function() {
23 content::should::be::irrelevant();
26 // @has doc_cfg/unix_only/trait.ArmOnly.html \
27 // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
28 // 'This is supported on Unix and ARM only.'
29 // @count - '//*[@class="stab portability"]' 3
30 #[doc(cfg(target_arch = "arm"))]
32 fn unix_and_arm_only_function();
35 impl ArmOnly for super::Portable {
36 fn unix_and_arm_only_function() {}
40 // tagging a function with `#[target_feature]` creates a doc(cfg(target_feature)) node for that
43 // the portability header is different on the module view versus the full view
44 // @has doc_cfg/index.html
45 // @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\Aavx\Z'
47 // @has doc_cfg/fn.uses_target_feature.html
48 // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
49 // 'This is supported with target feature avx only.'
50 #[target_feature(enable = "avx")]
51 pub unsafe fn uses_target_feature() {
52 content::should::be::irrelevant();
55 // @has doc_cfg/fn.uses_cfg_target_feature.html
56 // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
57 // 'This is supported with target feature avx only.'
58 #[doc(cfg(target_feature = "avx"))]
59 pub fn uses_cfg_target_feature() {
60 uses_target_feature();