Skip to content

Commit d001f54

Browse files
committed
Move target_feature remarks to note blocks
1 parent 1d719db commit d001f54

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
@@ -102,6 +102,14 @@ The *`target_feature` [attribute]* may be applied to a function to enable code g
102102
> fn foo_avx2() {}
103103
> ```
104104
105+
> [!NOTE]
106+
> 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.
107+
>
108+
> See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros in the standard library for runtime feature detection on these platforms.
109+
110+
> [!NOTE]
111+
> `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.
112+
105113
r[attributes.codegen.target_feature.syntax]
106114
The syntax for the `target_feature` attribute is:
107115
@@ -483,18 +491,6 @@ Feature | Implicitly Enables | Description
483491
[tail-call]: https://github.com/webassembly/tail-call
484492
[multivalue]: https://github.com/webassembly/multi-value
485493

486-
r[attributes.codegen.target_feature.info]
487-
### Additional information
488-
489-
r[attributes.codegen.target_feature.remark-cfg]
490-
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.
491-
492-
r[attributes.codegen.target_feature.remark-rt]
493-
See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros in the standard library for runtime feature detection on these platforms.
494-
495-
> [!NOTE]
496-
> `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.
497-
498494
r[attributes.codegen.track_caller]
499495
## The `track_caller` attribute
500496

0 commit comments

Comments
 (0)