@@ -66,8 +66,7 @@ pub struct Frame<'tcx> {
6666 pub return_to_block : StackPopCleanup ,
6767
6868 /// The location where the result of the current stack frame should be written to.
69- /// None if the function is a diverging function
70- pub return_lvalue : Option < Lvalue < ' tcx > > ,
69+ pub return_lvalue : Lvalue < ' tcx > ,
7170
7271 /// The list of locals for this stack frame, stored in order as
7372 /// `[arguments..., variables..., temporaries...]`. The locals are stored as `Option<Value>`s.
@@ -267,7 +266,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
267266 instance : ty:: Instance < ' tcx > ,
268267 span : codemap:: Span ,
269268 mir : & ' tcx mir:: Mir < ' tcx > ,
270- return_lvalue : Option < Lvalue < ' tcx > > ,
269+ return_lvalue : Lvalue < ' tcx > ,
271270 return_to_block : StackPopCleanup ,
272271 ) -> EvalResult < ' tcx > {
273272 :: log_settings:: settings ( ) . indentation += 1 ;
@@ -324,7 +323,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
324323 :: log_settings:: settings ( ) . indentation -= 1 ;
325324 let frame = self . stack . pop ( ) . expect ( "tried to pop a stack frame, but there were none" ) ;
326325 match frame. return_to_block {
327- StackPopCleanup :: MarkStatic ( mutable) => if let Lvalue :: Global ( id) = frame. return_lvalue . expect ( "diverging static" ) {
326+ StackPopCleanup :: MarkStatic ( mutable) => if let Lvalue :: Global ( id) = frame. return_lvalue {
328327 let global_value = self . globals . get_mut ( & id)
329328 . expect ( "global should have been cached (static)" ) ;
330329 match global_value. value {
@@ -1630,7 +1629,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
16301629 start_instance,
16311630 start_mir. span ,
16321631 start_mir,
1633- Some ( Lvalue :: from_ptr ( ret_ptr) ) ,
1632+ Lvalue :: from_ptr ( ret_ptr) ,
16341633 StackPopCleanup :: None ,
16351634 ) ?;
16361635
@@ -1657,7 +1656,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
16571656 main_instance,
16581657 main_mir. span ,
16591658 main_mir,
1660- Some ( Lvalue :: zst ( ) ) ,
1659+ Lvalue :: zst ( ) ,
16611660 StackPopCleanup :: None ,
16621661 ) ?;
16631662 }
0 commit comments