Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/callconv/mips64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
if !fn_abi.ret.is_ignore() {
if !fn_abi.ret.is_ignore() && fn_abi.ret.layout.is_sized() {
classify_ret(cx, &mut fn_abi.ret);
}

for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
if arg.is_ignore() || !arg.layout.is_sized() {
continue;
}
classify_arg(cx, arg);
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_target/src/callconv/sparc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,14 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec,
{
if !fn_abi.ret.is_ignore() {
if !fn_abi.ret.is_ignore() && fn_abi.ret.layout.is_sized() {
classify_arg(cx, &mut fn_abi.ret, Size::from_bytes(32));
}

for arg in fn_abi.args.iter_mut() {
if !arg.layout.is_sized() {
continue;
}
if arg.is_ignore() {
// sparc64-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs.
if cx.target_spec().os == Os::Linux
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/abi/compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ macro_rules! test_transparent_unsized {
};
}

#[cfg(not(any(target_arch = "mips64", target_arch = "sparc64")))]
// NOTE: non-rustic ABIs do not support unsized types: they are skipped during ABI generation, and
// will trigger an error if they make it to rustc_monomorphize/src/mono_checks/abi_check.rs
mod unsized_ {
use super::*;
test_transparent_unsized!(str_, str);
Expand Down
Loading