@@ -221,27 +221,37 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
221
221
222
222
let init = & this. thir [ * initializer] ;
223
223
let initializer_span = init. span ;
224
- this. declare_bindings (
225
- visibility_scope,
226
- remainder_span,
227
- pattern,
228
- ArmHasGuard ( false ) ,
229
- Some ( ( None , initializer_span) ) ,
230
- ) ;
231
- this. visit_primary_bindings (
232
- pattern,
233
- UserTypeProjections :: none ( ) ,
234
- & mut |this, _, _, _, node, span, _, _| {
235
- this. storage_live_binding ( block, node, span, OutsideGuard , true ) ;
236
- this. schedule_drop_for_binding ( node, span, OutsideGuard ) ;
237
- } ,
238
- ) ;
239
224
let failure = unpack ! (
240
225
block = this. in_opt_scope(
241
226
opt_destruction_scope. map( |de| ( de, source_info) ) ,
242
227
|this| {
243
228
let scope = ( * init_scope, source_info) ;
244
229
this. in_scope( scope, * lint_level, |this| {
230
+ this. declare_bindings(
231
+ visibility_scope,
232
+ remainder_span,
233
+ pattern,
234
+ ArmHasGuard ( false ) ,
235
+ Some ( ( None , initializer_span) ) ,
236
+ ) ;
237
+ this. visit_primary_bindings(
238
+ pattern,
239
+ UserTypeProjections :: none( ) ,
240
+ & mut |this, _, _, _, node, span, _, _| {
241
+ this. storage_live_binding(
242
+ block,
243
+ node,
244
+ span,
245
+ OutsideGuard ,
246
+ true ,
247
+ ) ;
248
+ this. schedule_drop_for_binding(
249
+ node,
250
+ span,
251
+ OutsideGuard ,
252
+ ) ;
253
+ } ,
254
+ ) ;
245
255
this. ast_let_else(
246
256
block,
247
257
init,
@@ -306,7 +316,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
306
316
ArmHasGuard ( false ) ,
307
317
Some ( ( None , initializer_span) ) ,
308
318
) ;
309
- this. expr_into_pattern( block, & pattern, init) // irrefutable pattern
319
+ this. expr_into_pattern( block, & pattern, init)
320
+ // irrefutable pattern
310
321
} )
311
322
} ,
312
323
)
0 commit comments