You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The *`target_feature`[attribute]* may be applied to a function to enable code generation of that function for specific platform architecture features. It uses the [MetaListNameValueStr] syntax with a single key of `enable` whose value is a string of comma-separated feature names to enable.
97
97
98
-
```rust
99
-
# #[cfg(target_feature ="avx2")]
100
-
#[target_feature(enable ="avx2")]
101
-
fnfoo_avx2() {}
102
-
```
98
+
> [!EXAMPLE]
99
+
> ```rust
100
+
> # #[cfg(target_feature ="avx2")]
101
+
> #[target_feature(enable ="avx2")]
102
+
> fnfoo_avx2() {}
103
+
> ```
103
104
104
105
r[attributes.codegen.target_feature.arch]
105
106
Each [targetarchitecture] hasasetoffeaturesthatmaybeenabled.Itisanerrortospecifyafeatureforatargetarchitecturethatthecrateisnotbeingcompiledfor.
0 commit comments