Skip to content

Commit b7881bb

Browse files
committed
Remove CPlace::no_place
It is never the right function
1 parent 8704a66 commit b7881bb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/abi/returning.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ pub(super) fn codegen_return_param<'tcx>(
5858
block_params_iter: &mut impl Iterator<Item = Value>,
5959
) -> CPlace<'tcx> {
6060
let (ret_place, ret_param): (_, SmallVec<[_; 2]>) = match fx.fn_abi.as_ref().unwrap().ret.mode {
61-
PassMode::Ignore => (CPlace::no_place(fx.fn_abi.as_ref().unwrap().ret.layout), smallvec![]),
62-
PassMode::Direct(_) | PassMode::Pair(_, _) | PassMode::Cast(_) => {
61+
PassMode::Ignore | PassMode::Direct(_) | PassMode::Pair(_, _) | PassMode::Cast(_) => {
6362
let is_ssa = ssa_analyzed[RETURN_PLACE] == crate::analyze::SsaKind::Ssa;
6463
(
6564
super::make_local_place(

src/value_and_place.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,16 @@ impl<'tcx> CPlace<'tcx> {
318318
&self.inner
319319
}
320320

321-
pub(crate) fn no_place(layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
322-
CPlace { inner: CPlaceInner::Addr(Pointer::dangling(layout.align.pref), None), layout }
323-
}
324-
325321
pub(crate) fn new_stack_slot(
326322
fx: &mut FunctionCx<'_, '_, 'tcx>,
327323
layout: TyAndLayout<'tcx>,
328324
) -> CPlace<'tcx> {
329325
assert!(!layout.is_unsized());
330326
if layout.size.bytes() == 0 {
331-
return CPlace::no_place(layout);
327+
return CPlace {
328+
inner: CPlaceInner::Addr(Pointer::dangling(layout.align.pref), None),
329+
layout,
330+
};
332331
}
333332

334333
let stack_slot = fx.bcx.create_stack_slot(StackSlotData {

0 commit comments

Comments
 (0)