@@ -2280,15 +2280,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
22802280 mut block : BasicBlock ,
22812281 init : & Expr < ' tcx > ,
22822282 initializer_span : Span ,
2283- else_block : & Block ,
2283+ else_block : BlockId ,
22842284 visibility_scope : Option < SourceScope > ,
22852285 remainder_scope : region:: Scope ,
22862286 remainder_span : Span ,
22872287 pattern : & Pat < ' tcx > ,
22882288 ) -> BlockAnd < ( ) > {
2289+ let else_block_span = self . thir [ else_block] . span ;
22892290 let ( matching, failure) = self . in_if_then_scope ( remainder_scope, |this| {
22902291 let scrutinee = unpack ! ( block = this. lower_scrutinee( block, init, initializer_span) ) ;
2291- let pat = Pat { ty : init. ty , span : else_block . span , kind : Box :: new ( PatKind :: Wild ) } ;
2292+ let pat = Pat { ty : init. ty , span : else_block_span , kind : Box :: new ( PatKind :: Wild ) } ;
22922293 let mut wildcard = Candidate :: new ( scrutinee. clone ( ) , & pat, false ) ;
22932294 this. declare_bindings (
22942295 visibility_scope,
@@ -2318,7 +2319,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
23182319 ) ;
23192320 // This block is for the failure case
23202321 let failure = this. bind_pattern (
2321- this. source_info ( else_block . span ) ,
2322+ this. source_info ( else_block_span ) ,
23222323 wildcard,
23232324 None ,
23242325 & fake_borrow_temps,
@@ -2334,19 +2335,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
23342335 // This place is not really used because this destination place
23352336 // should never be used to take values at the end of the failure
23362337 // block.
2337- let dummy_place = self . temp ( self . tcx . types . never , else_block . span ) ;
2338+ let dummy_place = self . temp ( self . tcx . types . never , else_block_span ) ;
23382339 let failure_block;
23392340 unpack ! (
23402341 failure_block = self . ast_block(
23412342 dummy_place,
23422343 failure,
23432344 else_block,
2344- self . source_info( else_block . span ) ,
2345+ self . source_info( else_block_span ) ,
23452346 )
23462347 ) ;
23472348 self . cfg . terminate (
23482349 failure_block,
2349- self . source_info ( else_block . span ) ,
2350+ self . source_info ( else_block_span ) ,
23502351 TerminatorKind :: Unreachable ,
23512352 ) ;
23522353 matching. unit ( )
0 commit comments