diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/abi/returning.rs | 3 | ||||
| -rw-r--r-- | src/value_and_place.rs | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/abi/returning.rs b/src/abi/returning.rs index 3b126938f14..f9fc3992ae2 100644 --- a/src/abi/returning.rs +++ b/src/abi/returning.rs @@ -58,8 +58,7 @@ pub(super) fn codegen_return_param<'tcx>( block_params_iter: &mut impl Iterator<Item = Value>, ) -> CPlace<'tcx> { let (ret_place, ret_param): (_, SmallVec<[_; 2]>) = match fx.fn_abi.as_ref().unwrap().ret.mode { - PassMode::Ignore => (CPlace::no_place(fx.fn_abi.as_ref().unwrap().ret.layout), smallvec![]), - PassMode::Direct(_) | PassMode::Pair(_, _) | PassMode::Cast(_) => { + PassMode::Ignore | PassMode::Direct(_) | PassMode::Pair(_, _) | PassMode::Cast(_) => { let is_ssa = ssa_analyzed[RETURN_PLACE] == crate::analyze::SsaKind::Ssa; ( super::make_local_place( diff --git a/src/value_and_place.rs b/src/value_and_place.rs index d1b66ab02e1..364b3da92b8 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -318,17 +318,16 @@ impl<'tcx> CPlace<'tcx> { &self.inner } - pub(crate) fn no_place(layout: TyAndLayout<'tcx>) -> CPlace<'tcx> { - CPlace { inner: CPlaceInner::Addr(Pointer::dangling(layout.align.pref), None), layout } - } - pub(crate) fn new_stack_slot( fx: &mut FunctionCx<'_, '_, 'tcx>, layout: TyAndLayout<'tcx>, ) -> CPlace<'tcx> { assert!(!layout.is_unsized()); if layout.size.bytes() == 0 { - return CPlace::no_place(layout); + return CPlace { + inner: CPlaceInner::Addr(Pointer::dangling(layout.align.pref), None), + layout, + }; } let stack_slot = fx.bcx.create_stack_slot(StackSlotData { |
