diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-12-06 09:06:51 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-06-14 09:57:06 +0000 |
| commit | 3e944fa3917a58e30d970d2cce42c14c5edf390b (patch) | |
| tree | e86353894ddba0e0e06c8202632569bf8c4254c3 /compiler/rustc_ty_utils | |
| parent | 64033a4ee541c3e9c178fd593e979c74bb798cdc (diff) | |
| download | rust-3e944fa3917a58e30d970d2cce42c14c5edf390b.tar.gz rust-3e944fa3917a58e30d970d2cce42c14c5edf390b.zip | |
Remove all support for wasm's legacy ABI
Diffstat (limited to 'compiler/rustc_ty_utils')
| -rw-r--r-- | compiler/rustc_ty_utils/src/abi.rs | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index bb5187e4f5c..f0ff50318ab 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -403,28 +403,18 @@ fn fn_abi_sanity_check<'tcx>( // For an unsized type we'd only pass the sized prefix, so there is no universe // in which we ever want to allow this. assert!(sized, "`PassMode::Direct` for unsized type in ABI: {:#?}", fn_abi); + // This really shouldn't happen even for sized aggregates, since // `immediate_llvm_type` will use `layout.fields` to turn this Rust type into an // LLVM type. This means all sorts of Rust type details leak into the ABI. - // However wasm sadly *does* currently use this mode for it's "C" ABI so we - // have to allow it -- but we absolutely shouldn't let any more targets do - // that. (Also see <https://github.com/rust-lang/rust/issues/115666>.) - // - // The unadjusted ABI also uses Direct for all args and is ill-specified, + // The unadjusted ABI however uses Direct for all args. It is ill-specified, // but unfortunately we need it for calling certain LLVM intrinsics. - - match spec_abi { - ExternAbi::Unadjusted => {} - ExternAbi::C { unwind: _ } - if matches!(&*tcx.sess.target.arch, "wasm32" | "wasm64") => {} - _ => { - panic!( - "`PassMode::Direct` for aggregates only allowed for \"unadjusted\" functions and on wasm\n\ - Problematic type: {:#?}", - arg.layout, - ); - } - } + assert!( + matches!(spec_abi, ExternAbi::Unadjusted), + "`PassMode::Direct` for aggregates only allowed for \"unadjusted\"\n\ + Problematic type: {:#?}", + arg.layout, + ); } } } |
