@@ -317,7 +317,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
317
317
debug ! ( "pop_scope({:?}, {:?})" , extent, block) ;
318
318
// We need to have `cached_block`s available for all the drops, so we call diverge_cleanup
319
319
// to make sure all the `cached_block`s are filled in.
320
- self . diverge_cleanup ( ) ;
320
+ self . diverge_cleanup ( extent . 1 . span ) ;
321
321
let scope = self . scopes . pop ( ) . unwrap ( ) ;
322
322
assert_eq ! ( scope. extent, extent. 0 ) ;
323
323
unpack ! ( block = build_scope_drops( & mut self . cfg,
@@ -562,7 +562,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
562
562
/// This path terminates in Resume. Returns the start of the path.
563
563
/// See module comment for more details. None indicates there’s no
564
564
/// cleanup to do at this point.
565
- pub ( crate ) fn diverge_cleanup ( & mut self ) -> Option < BasicBlock > {
565
+ pub ( crate ) fn diverge_cleanup ( & mut self , _span : Span ) -> Option < BasicBlock > {
566
566
if !self . scopes . iter ( ) . any ( |scope| scope. needs_cleanup ) {
567
567
return None ;
568
568
}
@@ -612,7 +612,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
612
612
}
613
613
let source_info = self . source_info ( span) ;
614
614
let next_target = self . cfg . start_new_block ( ) ;
615
- let diverge_target = self . diverge_cleanup ( ) ;
615
+ let diverge_target = self . diverge_cleanup ( span ) ;
616
616
self . cfg . terminate ( block, source_info,
617
617
TerminatorKind :: Drop {
618
618
location : location,
@@ -630,7 +630,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
630
630
value : Operand < ' tcx > ) -> BlockAnd < ( ) > {
631
631
let source_info = self . source_info ( span) ;
632
632
let next_target = self . cfg . start_new_block ( ) ;
633
- let diverge_target = self . diverge_cleanup ( ) ;
633
+ let diverge_target = self . diverge_cleanup ( span ) ;
634
634
self . cfg . terminate ( block, source_info,
635
635
TerminatorKind :: DropAndReplace {
636
636
location : location,
@@ -653,7 +653,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
653
653
let source_info = self . source_info ( span) ;
654
654
655
655
let success_block = self . cfg . start_new_block ( ) ;
656
- let cleanup = self . diverge_cleanup ( ) ;
656
+ let cleanup = self . diverge_cleanup ( span ) ;
657
657
658
658
self . cfg . terminate ( block, source_info,
659
659
TerminatorKind :: Assert {
0 commit comments