fix ZST handling for Windows ABIs on MSVC target
This commit is contained in:
parent
67951d946a
commit
d760bb6603
10 changed files with 130 additions and 275 deletions
|
@ -192,6 +192,10 @@ pub fn is_enabled(
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns whether the ABI is stable to use.
|
||||||
|
///
|
||||||
|
/// Note that there is a separate check determining whether the ABI is even supported
|
||||||
|
/// on the current target; see `fn is_abi_supported` in `rustc_target::spec`.
|
||||||
pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
|
pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
|
||||||
match name {
|
match name {
|
||||||
// Stable
|
// Stable
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::{fmt, iter};
|
use std::{fmt, iter};
|
||||||
|
|
||||||
pub use rustc_abi::{Reg, RegKind};
|
pub use rustc_abi::{ExternAbi, Reg, RegKind};
|
||||||
use rustc_macros::HashStable_Generic;
|
use rustc_macros::HashStable_Generic;
|
||||||
use rustc_span::Symbol;
|
use rustc_span::Symbol;
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@ use crate::abi::{
|
||||||
self, AddressSpace, Align, BackendRepr, HasDataLayout, Pointer, Size, TyAbiInterface,
|
self, AddressSpace, Align, BackendRepr, HasDataLayout, Pointer, Size, TyAbiInterface,
|
||||||
TyAndLayout,
|
TyAndLayout,
|
||||||
};
|
};
|
||||||
use crate::spec::abi::Abi as SpecAbi;
|
use crate::spec::{HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, WasmCAbi};
|
||||||
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, WasmCAbi};
|
|
||||||
|
|
||||||
mod aarch64;
|
mod aarch64;
|
||||||
mod amdgpu;
|
mod amdgpu;
|
||||||
|
@ -627,20 +626,20 @@ impl<'a, Ty: fmt::Display> fmt::Debug for FnAbi<'a, Ty> {
|
||||||
#[derive(Copy, Clone, Debug, HashStable_Generic)]
|
#[derive(Copy, Clone, Debug, HashStable_Generic)]
|
||||||
pub enum AdjustForForeignAbiError {
|
pub enum AdjustForForeignAbiError {
|
||||||
/// Target architecture doesn't support "foreign" (i.e. non-Rust) ABIs.
|
/// Target architecture doesn't support "foreign" (i.e. non-Rust) ABIs.
|
||||||
Unsupported { arch: Symbol, abi: spec::abi::Abi },
|
Unsupported { arch: Symbol, abi: ExternAbi },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ty> FnAbi<'a, Ty> {
|
impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
pub fn adjust_for_foreign_abi<C>(
|
pub fn adjust_for_foreign_abi<C>(
|
||||||
&mut self,
|
&mut self,
|
||||||
cx: &C,
|
cx: &C,
|
||||||
abi: spec::abi::Abi,
|
abi: ExternAbi,
|
||||||
) -> Result<(), AdjustForForeignAbiError>
|
) -> Result<(), AdjustForForeignAbiError>
|
||||||
where
|
where
|
||||||
Ty: TyAbiInterface<'a, C> + Copy,
|
Ty: TyAbiInterface<'a, C> + Copy,
|
||||||
C: HasDataLayout + HasTargetSpec + HasWasmCAbiOpt + HasX86AbiOpt,
|
C: HasDataLayout + HasTargetSpec + HasWasmCAbiOpt + HasX86AbiOpt,
|
||||||
{
|
{
|
||||||
if abi == spec::abi::Abi::X86Interrupt {
|
if abi == ExternAbi::X86Interrupt {
|
||||||
if let Some(arg) = self.args.first_mut() {
|
if let Some(arg) = self.args.first_mut() {
|
||||||
arg.pass_by_stack_offset(None);
|
arg.pass_by_stack_offset(None);
|
||||||
}
|
}
|
||||||
|
@ -651,12 +650,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
match &spec.arch[..] {
|
match &spec.arch[..] {
|
||||||
"x86" => {
|
"x86" => {
|
||||||
let (flavor, regparm) = match abi {
|
let (flavor, regparm) = match abi {
|
||||||
spec::abi::Abi::Fastcall { .. } | spec::abi::Abi::Vectorcall { .. } => {
|
ExternAbi::Fastcall { .. } | ExternAbi::Vectorcall { .. } => {
|
||||||
(x86::Flavor::FastcallOrVectorcall, None)
|
(x86::Flavor::FastcallOrVectorcall, None)
|
||||||
}
|
}
|
||||||
spec::abi::Abi::C { .. }
|
ExternAbi::C { .. } | ExternAbi::Cdecl { .. } | ExternAbi::Stdcall { .. } => {
|
||||||
| spec::abi::Abi::Cdecl { .. }
|
|
||||||
| spec::abi::Abi::Stdcall { .. } => {
|
|
||||||
(x86::Flavor::General, cx.x86_abi_opt().regparm)
|
(x86::Flavor::General, cx.x86_abi_opt().regparm)
|
||||||
}
|
}
|
||||||
_ => (x86::Flavor::General, None),
|
_ => (x86::Flavor::General, None),
|
||||||
|
@ -666,11 +663,13 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
x86::compute_abi_info(cx, self, opts);
|
x86::compute_abi_info(cx, self, opts);
|
||||||
}
|
}
|
||||||
"x86_64" => match abi {
|
"x86_64" => match abi {
|
||||||
spec::abi::Abi::SysV64 { .. } => x86_64::compute_abi_info(cx, self),
|
ExternAbi::SysV64 { .. } => x86_64::compute_abi_info(cx, self),
|
||||||
spec::abi::Abi::Win64 { .. } => x86_win64::compute_abi_info(cx, self),
|
ExternAbi::Win64 { .. } | ExternAbi::Vectorcall { .. } => {
|
||||||
|
x86_win64::compute_abi_info(cx, self, abi)
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if cx.target_spec().is_like_windows {
|
if cx.target_spec().is_like_windows {
|
||||||
x86_win64::compute_abi_info(cx, self)
|
x86_win64::compute_abi_info(cx, self, abi)
|
||||||
} else {
|
} else {
|
||||||
x86_64::compute_abi_info(cx, self)
|
x86_64::compute_abi_info(cx, self)
|
||||||
}
|
}
|
||||||
|
@ -701,7 +700,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
"sparc" => sparc::compute_abi_info(cx, self),
|
"sparc" => sparc::compute_abi_info(cx, self),
|
||||||
"sparc64" => sparc64::compute_abi_info(cx, self),
|
"sparc64" => sparc64::compute_abi_info(cx, self),
|
||||||
"nvptx64" => {
|
"nvptx64" => {
|
||||||
if cx.target_spec().adjust_abi(abi, self.c_variadic) == spec::abi::Abi::PtxKernel {
|
if cx.target_spec().adjust_abi(abi, self.c_variadic) == ExternAbi::PtxKernel {
|
||||||
nvptx64::compute_ptx_kernel_abi_info(cx, self)
|
nvptx64::compute_ptx_kernel_abi_info(cx, self)
|
||||||
} else {
|
} else {
|
||||||
nvptx64::compute_abi_info(self)
|
nvptx64::compute_abi_info(self)
|
||||||
|
@ -730,7 +729,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn adjust_for_rust_abi<C>(&mut self, cx: &C, abi: SpecAbi)
|
pub fn adjust_for_rust_abi<C>(&mut self, cx: &C, abi: ExternAbi)
|
||||||
where
|
where
|
||||||
Ty: TyAbiInterface<'a, C> + Copy,
|
Ty: TyAbiInterface<'a, C> + Copy,
|
||||||
C: HasDataLayout + HasTargetSpec,
|
C: HasDataLayout + HasTargetSpec,
|
||||||
|
@ -821,7 +820,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||||
// that's how we connect up to LLVM and it's unstable
|
// that's how we connect up to LLVM and it's unstable
|
||||||
// anyway, we control all calls to it in libstd.
|
// anyway, we control all calls to it in libstd.
|
||||||
BackendRepr::Vector { .. }
|
BackendRepr::Vector { .. }
|
||||||
if abi != SpecAbi::RustIntrinsic && spec.simd_types_indirect =>
|
if abi != ExternAbi::RustIntrinsic && spec.simd_types_indirect =>
|
||||||
{
|
{
|
||||||
arg.make_indirect();
|
arg.make_indirect();
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
use rustc_abi::{BackendRepr, Float, Primitive};
|
use rustc_abi::{BackendRepr, ExternAbi, Float, Primitive};
|
||||||
|
|
||||||
use crate::abi::call::{ArgAbi, FnAbi, Reg};
|
use crate::abi::call::{ArgAbi, FnAbi, Reg};
|
||||||
use crate::spec::HasTargetSpec;
|
use crate::spec::HasTargetSpec;
|
||||||
|
|
||||||
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
|
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
|
||||||
|
|
||||||
pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
|
pub(crate) fn compute_abi_info<Ty>(
|
||||||
|
cx: &impl HasTargetSpec,
|
||||||
|
fn_abi: &mut FnAbi<'_, Ty>,
|
||||||
|
abi: ExternAbi,
|
||||||
|
) {
|
||||||
let fixup = |a: &mut ArgAbi<'_, Ty>| {
|
let fixup = |a: &mut ArgAbi<'_, Ty>| {
|
||||||
match a.layout.backend_repr {
|
match a.layout.backend_repr {
|
||||||
BackendRepr::Uninhabited | BackendRepr::Memory { sized: false } => {}
|
BackendRepr::Uninhabited | BackendRepr::Memory { sized: false } => {}
|
||||||
|
@ -40,11 +44,15 @@ pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'
|
||||||
fixup(&mut fn_abi.ret);
|
fixup(&mut fn_abi.ret);
|
||||||
}
|
}
|
||||||
for arg in fn_abi.args.iter_mut() {
|
for arg in fn_abi.args.iter_mut() {
|
||||||
if arg.is_ignore() {
|
if arg.is_ignore() && arg.layout.is_zst() {
|
||||||
// x86_64-pc-windows-gnu doesn't ignore ZSTs.
|
// Windows ABIs do not talk about ZST since such types do not exist in MSVC.
|
||||||
if cx.target_spec().os == "windows"
|
// In that sense we can do whatever we want here, and maybe we should throw an error
|
||||||
&& cx.target_spec().env == "gnu"
|
// (but of course that would be a massive breaking change now).
|
||||||
&& arg.layout.is_zst()
|
// We try to match clang and gcc, so we make windows-gnu and the native
|
||||||
|
// Windows ABIs (i.e., everything except for `extern "C"`) pass ZST via
|
||||||
|
// pointer indirection. windows-msvc `extern "C"` still skips ZST.
|
||||||
|
if (cx.target_spec().os == "windows" && cx.target_spec().env == "gnu")
|
||||||
|
|| !matches!(abi, ExternAbi::C { .. })
|
||||||
{
|
{
|
||||||
arg.make_indirect_from_ignore();
|
arg.make_indirect_from_ignore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2815,12 +2815,17 @@ impl Target {
|
||||||
Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false },
|
Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false },
|
||||||
Abi::EfiApi => Abi::C { unwind: false },
|
Abi::EfiApi => Abi::C { unwind: false },
|
||||||
|
|
||||||
// See commentary in `is_abi_supported`.
|
// See commentary in `is_abi_supported`: we map these ABIs to "C" when they do not make sense.
|
||||||
Abi::Stdcall { .. } | Abi::Thiscall { .. } if self.arch == "x86" => abi,
|
Abi::Stdcall { .. } | Abi::Thiscall { .. } | Abi::Fastcall { .. }
|
||||||
Abi::Stdcall { unwind } | Abi::Thiscall { unwind } => Abi::C { unwind },
|
if self.arch == "x86" =>
|
||||||
Abi::Fastcall { .. } if self.arch == "x86" => abi,
|
{
|
||||||
|
abi
|
||||||
|
}
|
||||||
Abi::Vectorcall { .. } if ["x86", "x86_64"].contains(&&self.arch[..]) => abi,
|
Abi::Vectorcall { .. } if ["x86", "x86_64"].contains(&&self.arch[..]) => abi,
|
||||||
Abi::Fastcall { unwind } | Abi::Vectorcall { unwind } => Abi::C { unwind },
|
Abi::Stdcall { unwind }
|
||||||
|
| Abi::Thiscall { unwind }
|
||||||
|
| Abi::Fastcall { unwind }
|
||||||
|
| Abi::Vectorcall { unwind } => Abi::C { unwind },
|
||||||
|
|
||||||
// The Windows x64 calling convention we use for `extern "Rust"`
|
// The Windows x64 calling convention we use for `extern "Rust"`
|
||||||
// <https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions#register-volatility-and-preservation>
|
// <https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions#register-volatility-and-preservation>
|
||||||
|
|
|
@ -267,8 +267,10 @@ fn fn_sig_for_fn_abi<'tcx>(
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv {
|
fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv {
|
||||||
|
let target = &tcx.sess.target;
|
||||||
|
|
||||||
use rustc_abi::ExternAbi::*;
|
use rustc_abi::ExternAbi::*;
|
||||||
match tcx.sess.target.adjust_abi(abi, c_variadic) {
|
match target.adjust_abi(abi, c_variadic) {
|
||||||
RustIntrinsic | Rust | RustCall => Conv::Rust,
|
RustIntrinsic | Rust | RustCall => Conv::Rust,
|
||||||
|
|
||||||
// This is intentionally not using `Conv::Cold`, as that has to preserve
|
// This is intentionally not using `Conv::Cold`, as that has to preserve
|
||||||
|
@ -279,10 +281,37 @@ fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv
|
||||||
System { .. } => bug!("system abi should be selected elsewhere"),
|
System { .. } => bug!("system abi should be selected elsewhere"),
|
||||||
EfiApi => bug!("eficall abi should be selected elsewhere"),
|
EfiApi => bug!("eficall abi should be selected elsewhere"),
|
||||||
|
|
||||||
Stdcall { .. } => Conv::X86Stdcall,
|
// See commentary in `is_abi_supported`: we map these to "C" on targets
|
||||||
Fastcall { .. } => Conv::X86Fastcall,
|
// where they do not make sense.
|
||||||
Vectorcall { .. } => Conv::X86VectorCall,
|
Stdcall { .. } => {
|
||||||
Thiscall { .. } => Conv::X86ThisCall,
|
if target.arch == "x86" {
|
||||||
|
Conv::X86Stdcall
|
||||||
|
} else {
|
||||||
|
Conv::C
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Fastcall { .. } => {
|
||||||
|
if target.arch == "x86" {
|
||||||
|
Conv::X86Fastcall
|
||||||
|
} else {
|
||||||
|
Conv::C
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Vectorcall { .. } => {
|
||||||
|
if ["x86", "x86_64"].contains(&&target.arch[..]) {
|
||||||
|
Conv::X86VectorCall
|
||||||
|
} else {
|
||||||
|
Conv::C
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Thiscall { .. } => {
|
||||||
|
if target.arch == "x86" {
|
||||||
|
Conv::X86ThisCall
|
||||||
|
} else {
|
||||||
|
Conv::C
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
C { .. } => Conv::C,
|
C { .. } => Conv::C,
|
||||||
Unadjusted => Conv::C,
|
Unadjusted => Conv::C,
|
||||||
Win64 { .. } => Conv::X86_64Win64,
|
Win64 { .. } => Conv::X86_64Win64,
|
||||||
|
|
52
tests/codegen/abi-win64-zst.rs
Normal file
52
tests/codegen/abi-win64-zst.rs
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
//@ compile-flags: -Z merge-functions=disabled
|
||||||
|
|
||||||
|
//@ revisions: windows-gnu
|
||||||
|
//@[windows-gnu] compile-flags: --target x86_64-pc-windows-gnu
|
||||||
|
//@[windows-gnu] needs-llvm-components: x86
|
||||||
|
|
||||||
|
//@ revisions: windows-msvc
|
||||||
|
//@[windows-msvc] compile-flags: --target x86_64-pc-windows-msvc
|
||||||
|
//@[windows-msvc] needs-llvm-components: x86
|
||||||
|
|
||||||
|
// Also test what happens when using a Windows ABI on Linux.
|
||||||
|
//@ revisions: linux
|
||||||
|
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
|
||||||
|
//@[linux] needs-llvm-components: x86
|
||||||
|
|
||||||
|
#![feature(no_core, lang_items, rustc_attrs, abi_vectorcall)]
|
||||||
|
#![no_core]
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
#[lang = "sized"]
|
||||||
|
trait Sized {}
|
||||||
|
|
||||||
|
// Make sure the argument is always passed when explicitly requesting a Windows ABI.
|
||||||
|
// Our goal here is to match clang: <https://clang.godbolt.org/z/Wr4jMWq3P>.
|
||||||
|
|
||||||
|
// CHECK: define win64cc void @pass_zst_win64(ptr {{.*}})
|
||||||
|
#[no_mangle]
|
||||||
|
extern "win64" fn pass_zst_win64(_: ()) {}
|
||||||
|
|
||||||
|
// CHECK: define x86_vectorcallcc void @pass_zst_vectorcall(ptr {{.*}})
|
||||||
|
#[no_mangle]
|
||||||
|
extern "vectorcall" fn pass_zst_vectorcall(_: ()) {}
|
||||||
|
|
||||||
|
// windows-gnu: define void @pass_zst_fastcall(ptr {{.*}})
|
||||||
|
// windows-msvc: define void @pass_zst_fastcall(ptr {{.*}})
|
||||||
|
#[no_mangle]
|
||||||
|
#[cfg(windows)] // "fastcall" is not valid on 64bit Linux
|
||||||
|
extern "fastcall" fn pass_zst_fastcall(_: ()) {}
|
||||||
|
|
||||||
|
// The sysv64 ABI ignores ZST.
|
||||||
|
|
||||||
|
// CHECK: define x86_64_sysvcc void @pass_zst_sysv64()
|
||||||
|
#[no_mangle]
|
||||||
|
extern "sysv64" fn pass_zst_sysv64(_: ()) {}
|
||||||
|
|
||||||
|
// For `extern "C"` functions, ZST are ignored on windows-msvc.
|
||||||
|
|
||||||
|
// linux: define void @pass_zst_c()
|
||||||
|
// windows-msvc: define void @pass_zst_c()
|
||||||
|
// windows-gnu: define void @pass_zst_c(ptr {{.*}})
|
||||||
|
#[no_mangle]
|
||||||
|
extern "C" fn pass_zst_c(_: ()) {}
|
|
@ -1,24 +0,0 @@
|
||||||
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
|
|
||||||
//@ only-x86_64
|
|
||||||
|
|
||||||
//@ revisions: x86_64-linux
|
|
||||||
//@[x86_64-linux] compile-flags: --target x86_64-unknown-linux-gnu
|
|
||||||
//@[x86_64-linux] needs-llvm-components: x86
|
|
||||||
|
|
||||||
//@ revisions: x86_64-windows-gnu
|
|
||||||
//@[x86_64-windows-gnu] compile-flags: --target x86_64-pc-windows-gnu
|
|
||||||
//@[x86_64-windows-gnu] needs-llvm-components: x86
|
|
||||||
|
|
||||||
//@ revisions: x86_64-windows-msvc
|
|
||||||
//@[x86_64-windows-msvc] compile-flags: --target x86_64-pc-windows-msvc
|
|
||||||
//@[x86_64-windows-msvc] needs-llvm-components: x86
|
|
||||||
|
|
||||||
#![feature(no_core, lang_items, rustc_attrs)]
|
|
||||||
#![no_core]
|
|
||||||
#![crate_type = "lib"]
|
|
||||||
|
|
||||||
#[lang = "sized"]
|
|
||||||
trait Sized {}
|
|
||||||
|
|
||||||
#[rustc_abi(debug)]
|
|
||||||
extern "win64" fn pass_zst(_: ()) {} //~ ERROR: fn_abi
|
|
|
@ -1,69 +0,0 @@
|
||||||
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: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Ignore,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
ret: ArgAbi {
|
|
||||||
layout: TyAndLayout {
|
|
||||||
ty: (),
|
|
||||||
layout: Layout {
|
|
||||||
size: Size(0 bytes),
|
|
||||||
align: AbiAndPrefAlign {
|
|
||||||
abi: $SOME_ALIGN,
|
|
||||||
pref: $SOME_ALIGN,
|
|
||||||
},
|
|
||||||
abi: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Ignore,
|
|
||||||
},
|
|
||||||
c_variadic: false,
|
|
||||||
fixed_count: 1,
|
|
||||||
conv: X86_64Win64,
|
|
||||||
can_unwind: false,
|
|
||||||
}
|
|
||||||
--> $DIR/win64-zst.rs:24:1
|
|
||||||
|
|
|
||||||
LL | extern "win64" fn pass_zst(_: ()) {}
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
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: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Indirect {
|
|
||||||
attrs: ArgAttributes {
|
|
||||||
regular: NoAlias | NoCapture | NonNull | NoUndef,
|
|
||||||
arg_ext: None,
|
|
||||||
pointee_size: Size(0 bytes),
|
|
||||||
pointee_align: Some(
|
|
||||||
Align(1 bytes),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
meta_attrs: None,
|
|
||||||
on_stack: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
ret: ArgAbi {
|
|
||||||
layout: TyAndLayout {
|
|
||||||
ty: (),
|
|
||||||
layout: Layout {
|
|
||||||
size: Size(0 bytes),
|
|
||||||
align: AbiAndPrefAlign {
|
|
||||||
abi: $SOME_ALIGN,
|
|
||||||
pref: $SOME_ALIGN,
|
|
||||||
},
|
|
||||||
abi: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Ignore,
|
|
||||||
},
|
|
||||||
c_variadic: false,
|
|
||||||
fixed_count: 1,
|
|
||||||
conv: X86_64Win64,
|
|
||||||
can_unwind: false,
|
|
||||||
}
|
|
||||||
--> $DIR/win64-zst.rs:24:1
|
|
||||||
|
|
|
||||||
LL | extern "win64" fn pass_zst(_: ()) {}
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
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: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Ignore,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
ret: ArgAbi {
|
|
||||||
layout: TyAndLayout {
|
|
||||||
ty: (),
|
|
||||||
layout: Layout {
|
|
||||||
size: Size(0 bytes),
|
|
||||||
align: AbiAndPrefAlign {
|
|
||||||
abi: $SOME_ALIGN,
|
|
||||||
pref: $SOME_ALIGN,
|
|
||||||
},
|
|
||||||
abi: Memory {
|
|
||||||
sized: true,
|
|
||||||
},
|
|
||||||
fields: Arbitrary {
|
|
||||||
offsets: [],
|
|
||||||
memory_index: [],
|
|
||||||
},
|
|
||||||
largest_niche: None,
|
|
||||||
variants: Single {
|
|
||||||
index: 0,
|
|
||||||
},
|
|
||||||
max_repr_align: None,
|
|
||||||
unadjusted_abi_align: $SOME_ALIGN,
|
|
||||||
randomization_seed: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mode: Ignore,
|
|
||||||
},
|
|
||||||
c_variadic: false,
|
|
||||||
fixed_count: 1,
|
|
||||||
conv: X86_64Win64,
|
|
||||||
can_unwind: false,
|
|
||||||
}
|
|
||||||
--> $DIR/win64-zst.rs:24:1
|
|
||||||
|
|
|
||||||
LL | extern "win64" fn pass_zst(_: ()) {}
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue