diff --git a/compiler/rustc_target/src/callconv/mod.rs b/compiler/rustc_target/src/callconv/mod.rs index 7a7c63c475b04..f45f1379ece95 100644 --- a/compiler/rustc_target/src/callconv/mod.rs +++ b/compiler/rustc_target/src/callconv/mod.rs @@ -424,8 +424,10 @@ impl<'a, Ty> ArgAbi<'a, Ty> { PassMode::Indirect { .. } => { self.mode = PassMode::Direct(ArgAttributes::new()); } - PassMode::Ignore | PassMode::Direct(_) | PassMode::Pair(_, _) => {} // already direct - _ => panic!("Tried to make {:?} direct", self.mode), + PassMode::Ignore | PassMode::Direct(_) => {} // already direct + PassMode::Pair(_, _) | PassMode::Cast { .. } => { + panic!("Tried to make {:?} direct", self.mode) + } } } diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index e4ed084b073b6..7d56c4f045e07 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -592,8 +592,6 @@ fn fn_abi_adjust_for_abi<'tcx>( // The "unadjusted" ABI passes aggregates in "direct" mode. That's fragile but needed for // some LLVM intrinsics. fn unadjust<'tcx>(arg: &mut ArgAbi<'tcx, Ty<'tcx>>) { - // This still uses `PassMode::Pair` for ScalarPair types. That's unlikely to be intended, - // but who knows what breaks if we change this now. if matches!(arg.layout.backend_repr, BackendRepr::Memory { .. }) { assert!( arg.layout.backend_repr.is_sized(),