|
1 | 1 | //@ only-x86_64 |
2 | 2 |
|
3 | 3 | //@ is "$.index[?(@.name=='test1')].attrs" '["#[target_feature(enable=\"avx\")]"]' |
| 4 | +//@ is "$.index[?(@.name=='test1')].inner.function.header.is_unsafe" false |
4 | 5 | #[target_feature(enable = "avx")] |
5 | 6 | pub fn test1() {} |
6 | 7 |
|
7 | 8 | //@ is "$.index[?(@.name=='test2')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\")]"]' |
| 9 | +//@ is "$.index[?(@.name=='test1')].inner.function.header.is_unsafe" false |
8 | 10 | #[target_feature(enable = "avx,avx2")] |
9 | 11 | pub fn test2() {} |
10 | 12 |
|
11 | 13 | //@ is "$.index[?(@.name=='test3')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\")]"]' |
| 14 | +//@ is "$.index[?(@.name=='test1')].inner.function.header.is_unsafe" false |
12 | 15 | #[target_feature(enable = "avx", enable = "avx2")] |
13 | 16 | pub fn test3() {} |
14 | 17 |
|
15 | 18 | //@ is "$.index[?(@.name=='test4')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\", enable=\"avx512f\")]"]' |
| 19 | +//@ is "$.index[?(@.name=='test1')].inner.function.header.is_unsafe" false |
16 | 20 | #[target_feature(enable = "avx", enable = "avx2,avx512f")] |
17 | 21 | pub fn test4() {} |
| 22 | + |
| 23 | +//@ is "$.index[?(@.name=='test_unsafe_fn')].attrs" '["#[target_feature(enable=\"avx\")]"]' |
| 24 | +//@ is "$.index[?(@.name=='test_unsafe_fn')].inner.function.header.is_unsafe" true |
| 25 | +#[target_feature(enable = "avx")] |
| 26 | +pub unsafe fn test_unsafe_fn() {} |
| 27 | + |
| 28 | +pub struct Example; |
| 29 | + |
| 30 | +impl Example { |
| 31 | + //@ is "$.index[?(@.name=='safe_assoc_fn')].attrs" '["#[target_feature(enable=\"avx\")]"]' |
| 32 | + //@ is "$.index[?(@.name=='safe_assoc_fn')].inner.function.header.is_unsafe" false |
| 33 | + #[target_feature(enable = "avx")] |
| 34 | + pub fn safe_assoc_fn() {} |
| 35 | + |
| 36 | + //@ is "$.index[?(@.name=='unsafe_assoc_fn')].attrs" '["#[target_feature(enable=\"avx\")]"]' |
| 37 | + //@ is "$.index[?(@.name=='unsafe_assoc_fn')].inner.function.header.is_unsafe" true |
| 38 | + #[target_feature(enable = "avx")] |
| 39 | + pub unsafe fn unsafe_assoc_fn() {} |
| 40 | +} |
0 commit comments