@@ -317,7 +317,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
317317 debug ! ( "pop_scope({:?}, {:?})" , extent, block) ;
318318 // We need to have `cached_block`s available for all the drops, so we call diverge_cleanup
319319 // to make sure all the `cached_block`s are filled in.
320- self . diverge_cleanup ( ) ;
320+ self . diverge_cleanup ( extent . 1 . span ) ;
321321 let scope = self . scopes . pop ( ) . unwrap ( ) ;
322322 assert_eq ! ( scope. extent, extent. 0 ) ;
323323 unpack ! ( block = build_scope_drops( & mut self . cfg,
@@ -564,7 +564,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
564564 /// This path terminates in Resume. Returns the start of the path.
565565 /// See module comment for more details. None indicates there’s no
566566 /// cleanup to do at this point.
567- pub ( crate ) fn diverge_cleanup ( & mut self ) -> Option < BasicBlock > {
567+ pub ( crate ) fn diverge_cleanup ( & mut self , _span : Span ) -> Option < BasicBlock > {
568568 if !self . scopes . iter ( ) . any ( |scope| scope. needs_cleanup ) {
569569 return None ;
570570 }
@@ -614,7 +614,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
614614 }
615615 let source_info = self . source_info ( span) ;
616616 let next_target = self . cfg . start_new_block ( ) ;
617- let diverge_target = self . diverge_cleanup ( ) ;
617+ let diverge_target = self . diverge_cleanup ( span ) ;
618618 self . cfg . terminate ( block, source_info,
619619 TerminatorKind :: Drop {
620620 location : location,
@@ -632,7 +632,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
632632 value : Operand < ' tcx > ) -> BlockAnd < ( ) > {
633633 let source_info = self . source_info ( span) ;
634634 let next_target = self . cfg . start_new_block ( ) ;
635- let diverge_target = self . diverge_cleanup ( ) ;
635+ let diverge_target = self . diverge_cleanup ( span ) ;
636636 self . cfg . terminate ( block, source_info,
637637 TerminatorKind :: DropAndReplace {
638638 location : location,
@@ -655,7 +655,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
655655 let source_info = self . source_info ( span) ;
656656
657657 let success_block = self . cfg . start_new_block ( ) ;
658- let cleanup = self . diverge_cleanup ( ) ;
658+ let cleanup = self . diverge_cleanup ( span ) ;
659659
660660 self . cfg . terminate ( block, source_info,
661661 TerminatorKind :: Assert {
0 commit comments