File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 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
9797Implicitly enabled features are included in this rule. For example an ` sse2 ` function can call ones marked with ` sse ` .
9898
9999``` 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 () {}
103103
104104fn 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
107107 // platform or manually enabled as compiler flags.
108108 unsafe {
109- foo_avx ();
109+ foo_sse ();
110110 }
111111}
112112
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 ();
118118}
119119
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 ();
124124}
125125# }
126126```
You can’t perform that action at this time.
0 commit comments