Skip to content

Commit 6645bd7

Browse files
authored
Merge pull request #1868 from ehuss/fix-codegen-link-references
Fix placement of codegen link definitions
2 parents 50fc162 + 8e8366a commit 6645bd7

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

src/attributes/codegen.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -611,28 +611,6 @@ trait object whose methods are attributed.
611611
> [!NOTE]
612612
> The aforementioned shim for function pointers is necessary because `rustc` implements `track_caller` in a codegen context by appending an implicit parameter to the function ABI, but this would be unsound for an indirect call because the parameter is not a part of the function's type and a given function pointer type may or may not refer to a function with the attribute. The creation of a shim hides the implicit parameter from callers of the function pointer, preserving soundness.
613613
614-
[`-C target-cpu`]: ../../rustc/codegen-options/index.html#target-cpu
615-
[`-C target-feature`]: ../../rustc/codegen-options/index.html#target-feature
616-
[`inline`]: #the-inline-attribute
617-
[`is_x86_feature_detected`]: ../../std/arch/macro.is_x86_feature_detected.html
618-
[`is_aarch64_feature_detected`]: ../../std/arch/macro.is_aarch64_feature_detected.html
619-
[`naked_asm!`]: ../inline-assembly.md
620-
[`target_feature` conditional compilation option]: ../conditional-compilation.md#target_feature
621-
[`track_caller`]: #the-track-caller-attribute
622-
[`unused_variables`]: ../../rustc/lints/listing/warn-by-default.html#unused-variables
623-
[attribute]: ../attributes.md
624-
[attributes]: ../attributes.md
625-
[FFI-safe]: ../../rustc/lints/listing/warn-by-default.html#improper-ctypes-definitions
626-
[function body]: ../items/functions.md#function-body
627-
[functions]: ../items/functions.md
628-
[rules for inline assembly]: ../inline-assembly.md#rules-for-inline-assembly
629-
[target architecture]: ../conditional-compilation.md#target_arch
630-
[trait]: ../items/traits.md
631-
[undefined behavior]: ../behavior-considered-undefined.md
632-
[unsafe attribute]: ../attributes.md#r-attributes.safety
633-
[rust-abi]: ../items/external-blocks.md#abi
634-
[`Location`]: core::panic::Location
635-
636614
r[attributes.codegen.instruction_set]
637615
## The `instruction_set` attribute
638616

@@ -668,3 +646,21 @@ Using the `instruction_set` attribute has the following effects:
668646

669647
* If the address of the function is taken as a function pointer, the low bit of the address will be set to 0 (arm) or 1 (thumb) depending on the instruction set.
670648
* Any inline assembly in the function must use the specified instruction set instead of the target default.
649+
650+
[`-C target-cpu`]: ../../rustc/codegen-options/index.html#target-cpu
651+
[`-C target-feature`]: ../../rustc/codegen-options/index.html#target-feature
652+
[`is_aarch64_feature_detected`]: ../../std/arch/macro.is_aarch64_feature_detected.html
653+
[`is_x86_feature_detected`]: ../../std/arch/macro.is_x86_feature_detected.html
654+
[`Location`]: core::panic::Location
655+
[`naked_asm!`]: ../inline-assembly.md
656+
[`target_feature` conditional compilation option]: ../conditional-compilation.md#target_feature
657+
[`unused_variables`]: ../../rustc/lints/listing/warn-by-default.html#unused-variables
658+
[attribute]: ../attributes.md
659+
[attributes]: ../attributes.md
660+
[function body]: ../items/functions.md#function-body
661+
[functions]: ../items/functions.md
662+
[rust-abi]: ../items/external-blocks.md#abi
663+
[target architecture]: ../conditional-compilation.md#target_arch
664+
[trait]: ../items/traits.md
665+
[undefined behavior]: ../behavior-considered-undefined.md
666+
[unsafe attribute]: ../attributes.md#r-attributes.safety

0 commit comments

Comments
 (0)