Skip to content

Commit d2fd277

Browse files
committed
Don't allow PassMode::Pair for unadjusted calls
1 parent 4793ef5 commit d2fd277

File tree

2 files changed

+4
-4
lines changed
  • compiler

2 files changed

+4
-4
lines changed

compiler/rustc_target/src/callconv/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,10 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
424424
PassMode::Indirect { .. } => {
425425
self.mode = PassMode::Direct(ArgAttributes::new());
426426
}
427-
PassMode::Ignore | PassMode::Direct(_) | PassMode::Pair(_, _) => {} // already direct
428-
_ => panic!("Tried to make {:?} direct", self.mode),
427+
PassMode::Ignore | PassMode::Direct(_) => {} // already direct
428+
PassMode::Pair(_, _) | PassMode::Cast { .. } => {
429+
panic!("Tried to make {:?} direct", self.mode)
430+
}
429431
}
430432
}
431433

compiler/rustc_ty_utils/src/abi.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,6 @@ fn fn_abi_adjust_for_abi<'tcx>(
592592
// The "unadjusted" ABI passes aggregates in "direct" mode. That's fragile but needed for
593593
// some LLVM intrinsics.
594594
fn unadjust<'tcx>(arg: &mut ArgAbi<'tcx, Ty<'tcx>>) {
595-
// This still uses `PassMode::Pair` for ScalarPair types. That's unlikely to be intended,
596-
// but who knows what breaks if we change this now.
597595
if matches!(arg.layout.backend_repr, BackendRepr::Memory { .. }) {
598596
assert!(
599597
arg.layout.backend_repr.is_sized(),

0 commit comments

Comments
 (0)