File tree 1 file changed +15
-15
lines changed
1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -97,30 +97,30 @@ The following restrictions apply unless otherwise specified by the platform rule
97
97
Implicitly enabled features are included in this rule. For example an ` sse2 ` function can call ones marked with ` sse ` .
98
98
99
99
``` rust
100
- # #[cfg(target_feature = " avx2 " )] {
101
- #[target_feature(enable = " avx " )]
102
- fn foo_avx () {}
100
+ # #[cfg(target_feature = " sse2 " )] {
101
+ #[target_feature(enable = " sse " )]
102
+ fn foo_sse () {}
103
103
104
104
fn bar () {
105
- // Calling `foo_avx ` here is unsafe, as we must ensure that AVX is
106
- // available first, even if `avx ` is enabled by default on the target
105
+ // Calling `foo_sse ` here is unsafe, as we must ensure that SSE is
106
+ // available first, even if `sse ` is enabled by default on the target
107
107
// platform or manually enabled as compiler flags.
108
108
unsafe {
109
- foo_avx ();
109
+ foo_sse ();
110
110
}
111
111
}
112
112
113
- #[target_feature(enable = " avx " )]
114
- fn bar_avx () {
115
- // Calling `foo_avx ` here is safe.
116
- foo_avx ();
117
- || foo_avx ();
113
+ #[target_feature(enable = " sse " )]
114
+ fn bar_sse () {
115
+ // Calling `foo_sse ` here is safe.
116
+ foo_sse ();
117
+ || foo_sse ();
118
118
}
119
119
120
- #[target_feature(enable = " avx2 " )]
121
- fn bar_avx2 () {
122
- // Calling `foo_avx ` here is safe because `avx2 ` implies `avx `.
123
- foo_avx ();
120
+ #[target_feature(enable = " sse2 " )]
121
+ fn bar_sse2 () {
122
+ // Calling `foo_sse ` here is safe because `sse2 ` implies `sse `.
123
+ foo_sse ();
124
124
}
125
125
# }
126
126
```
You can’t perform that action at this time.
0 commit comments