-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #125854 - beetrees:zst-arg-abi, r=estebank
Move ZST ABI handling to `rustc_target` Currently, target specific handling of ZST function call ABI (specifically passing them indirectly instead of ignoring them) is handled in `rustc_ty_utils`, whereas all other target specific function call ABI handling is located in `rustc_target`. This PR moves the ZST handling to `rustc_target` so that all the target-specific function call ABI handling is in one place. In the process of doing so, this PR fixes #125850 by ensuring that ZST arguments are always correctly ignored in the x86-64 `"sysv64"` ABI; any code which would be affected by this fix would have ICEd before this PR. Tests are also added using `#[rustc_abi(debug)]` to ensure this behaviour does not regress. Fixes #125850
- Loading branch information
Showing
19 changed files
with
766 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
error: fn_abi_of(pass_zst) = FnAbi { | ||
args: [ | ||
ArgAbi { | ||
layout: TyAndLayout { | ||
ty: (), | ||
layout: Layout { | ||
size: Size(0 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: $SOME_ALIGN, | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Aggregate { | ||
sized: true, | ||
}, | ||
fields: Arbitrary { | ||
offsets: [], | ||
memory_index: [], | ||
}, | ||
largest_niche: None, | ||
variants: Single { | ||
index: 0, | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: $SOME_ALIGN, | ||
}, | ||
}, | ||
mode: Ignore, | ||
}, | ||
], | ||
ret: ArgAbi { | ||
layout: TyAndLayout { | ||
ty: (), | ||
layout: Layout { | ||
size: Size(0 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: $SOME_ALIGN, | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Aggregate { | ||
sized: true, | ||
}, | ||
fields: Arbitrary { | ||
offsets: [], | ||
memory_index: [], | ||
}, | ||
largest_niche: None, | ||
variants: Single { | ||
index: 0, | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: $SOME_ALIGN, | ||
}, | ||
}, | ||
mode: Ignore, | ||
}, | ||
c_variadic: false, | ||
fixed_count: 1, | ||
conv: C, | ||
can_unwind: false, | ||
} | ||
--> $DIR/c-zst.rs:27:1 | ||
| | ||
LL | extern "C" fn pass_zst(_: ()) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
Oops, something went wrong.