@@ -108,7 +108,7 @@ pub struct Frame<'mir, 'tcx, Prov: Provenance = CtfeProvenance, Extra = ()> {
108
108
109
109
/// The location where the result of the current stack frame should be written to,
110
110
/// and its layout in the caller.
111
- pub return_place : PlaceTy < ' tcx , Prov > ,
111
+ pub return_place : MPlaceTy < ' tcx , Prov > ,
112
112
113
113
/// The list of locals for this stack frame, stored in order as
114
114
/// `[return_ptr, arguments..., variables..., temporaries...]`.
@@ -777,12 +777,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
777
777
trace ! ( "body: {:#?}" , body) ;
778
778
let dead_local = LocalState { value : LocalValue :: Dead , layout : Cell :: new ( None ) } ;
779
779
let locals = IndexVec :: from_elem ( dead_local, & body. local_decls ) ;
780
+ let return_place = self . force_allocation ( return_place) ?; // avoid a long-lived `PlaceTy`
780
781
// First push a stack frame so we have access to the local args
781
782
let pre_frame = Frame {
782
783
body,
783
784
loc : Right ( body. span ) , // Span used for errors caused during preamble.
784
785
return_to_block,
785
- return_place : return_place . clone ( ) ,
786
+ return_place,
786
787
locals,
787
788
instance,
788
789
tracing_span : SpanGuard :: new ( ) ,
@@ -912,7 +913,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
912
913
} else {
913
914
self . copy_op_allow_transmute ( & op, & dest)
914
915
} ;
915
- trace ! ( "return value: {:?}" , self . dump_place( & dest) ) ;
916
+ trace ! ( "return value: {:?}" , self . dump_place( & dest. into ( ) ) ) ;
916
917
// We delay actually short-circuiting on this error until *after* the stack frame is
917
918
// popped, since we want this error to be attributed to the caller, whose type defines
918
919
// this transmute.
0 commit comments