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"]' '\AARM\Z'
14 // @count - '//*[@class="stab portability"]' 2
17 // @has doc_cfg/unix_only/fn.unix_only_function.html \
18 // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
19 // 'This is supported on Unix only.'
20 // @count - '//*[@class="stab portability"]' 1
21 pub fn unix_only_function() {
22 content::should::be::irrelevant();
25 // @has doc_cfg/unix_only/trait.ArmOnly.html \
26 // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
27 // 'This is supported on Unix and ARM only.'
28 // @count - '//*[@class="stab portability"]' 2
29 #[doc(cfg(target_arch = "arm"))]
31 fn unix_and_arm_only_function();
34 impl ArmOnly for super::Portable {
35 fn unix_and_arm_only_function() {}
39 // tagging a function with `#[target_feature]` creates a doc(cfg(target_feature)) node for that
42 // the portability header is different on the module view versus the full view
43 // @has doc_cfg/index.html
44 // @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\Aavx\Z'
46 // @has doc_cfg/fn.uses_target_feature.html
47 // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
48 // 'This is supported with target feature avx only.'
49 #[target_feature(enable = "avx")]
50 pub unsafe fn uses_target_feature() {
51 content::should::be::irrelevant();
54 // @has doc_cfg/fn.uses_cfg_target_feature.html
55 // @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \
56 // 'This is supported with target feature avx only.'
57 #[doc(cfg(target_feature = "avx"))]
58 pub fn uses_cfg_target_feature() {
59 uses_target_feature();