Skip to content

Commit 3b3a7b8

Browse files
committed
Move example to an example block
1 parent 8fc864d commit 3b3a7b8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/attributes/codegen.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ r[attributes.codegen.target_feature]
9595
r[attributes.codegen.target_feature.intro]
9696
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.
9797

98-
```rust
99-
# #[cfg(target_feature = "avx2")]
100-
#[target_feature(enable = "avx2")]
101-
fn foo_avx2() {}
102-
```
98+
> [!EXAMPLE]
99+
> ```rust
100+
> # #[cfg(target_feature = "avx2")]
101+
> #[target_feature(enable = "avx2")]
102+
> fn foo_avx2() {}
103+
> ```
103104
104105
r[attributes.codegen.target_feature.arch]
105106
Each [target architecture] has a set of features that may be enabled. It is an error to specify a feature for a target architecture that the crate is not being compiled for.

0 commit comments

Comments
 (0)