Skip to content

Commit 7667617

Browse files
committed
Move target_feature remarks to note blocks
1 parent 6fbebbb commit 7667617

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/attributes/codegen.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ The *`target_feature` [attribute]* may be applied to a function to enable code g
194194
> fn foo_avx2() {}
195195
> ```
196196
197+
> [!NOTE]
198+
> See the [`target_feature` conditional compilation option] for selectively enabling or disabling compilation of code based on compile-time settings. Note that this option is not affected by the `target_feature` attribute, and is only driven by the features enabled for the entire crate.
199+
>
200+
> See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros in the standard library for runtime feature detection on these platforms.
201+
202+
> [!NOTE]
203+
> `rustc` has a default set of features enabled for each target and CPU. The CPU may be chosen with the [`-C target-cpu`] flag. Individual features may be enabled or disabled for an entire crate with the [`-C target-feature`] flag.
204+
197205
r[attributes.codegen.target_feature.syntax]
198206
The syntax for the `target_feature` attribute is:
199207
@@ -578,18 +586,6 @@ Feature | Implicitly Enables | Description
578586
[tail-call]: https://github.com/webassembly/tail-call
579587
[multivalue]: https://github.com/webassembly/multi-value
580588

581-
r[attributes.codegen.target_feature.info]
582-
### Additional information
583-
584-
r[attributes.codegen.target_feature.remark-cfg]
585-
See the [`target_feature` conditional compilation option] for selectively enabling or disabling compilation of code based on compile-time settings. Note that this option is not affected by the `target_feature` attribute, and is only driven by the features enabled for the entire crate.
586-
587-
r[attributes.codegen.target_feature.remark-rt]
588-
See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros in the standard library for runtime feature detection on these platforms.
589-
590-
> [!NOTE]
591-
> `rustc` has a default set of features enabled for each target and CPU. The CPU may be chosen with the [`-C target-cpu`] flag. Individual features may be enabled or disabled for an entire crate with the [`-C target-feature`] flag.
592-
593589
r[attributes.codegen.track_caller]
594590
## The `track_caller` attribute
595591

0 commit comments

Comments
 (0)