@@ -381,7 +381,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
381
381
crate fn as_place (
382
382
& mut self ,
383
383
mut block : BasicBlock ,
384
- expr : & Expr < ' _ , ' tcx > ,
384
+ expr : & Expr < ' tcx > ,
385
385
) -> BlockAnd < Place < ' tcx > > {
386
386
let place_builder = unpack ! ( block = self . as_place_builder( block, expr) ) ;
387
387
block. and ( place_builder. into_place ( self . tcx , self . typeck_results ) )
@@ -392,7 +392,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
392
392
crate fn as_place_builder (
393
393
& mut self ,
394
394
block : BasicBlock ,
395
- expr : & Expr < ' _ , ' tcx > ,
395
+ expr : & Expr < ' tcx > ,
396
396
) -> BlockAnd < PlaceBuilder < ' tcx > > {
397
397
self . expr_as_place ( block, expr, Mutability :: Mut , None )
398
398
}
@@ -405,7 +405,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
405
405
crate fn as_read_only_place (
406
406
& mut self ,
407
407
mut block : BasicBlock ,
408
- expr : & Expr < ' _ , ' tcx > ,
408
+ expr : & Expr < ' tcx > ,
409
409
) -> BlockAnd < Place < ' tcx > > {
410
410
let place_builder = unpack ! ( block = self . as_read_only_place_builder( block, expr) ) ;
411
411
block. and ( place_builder. into_place ( self . tcx , self . typeck_results ) )
@@ -420,15 +420,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
420
420
fn as_read_only_place_builder (
421
421
& mut self ,
422
422
block : BasicBlock ,
423
- expr : & Expr < ' _ , ' tcx > ,
423
+ expr : & Expr < ' tcx > ,
424
424
) -> BlockAnd < PlaceBuilder < ' tcx > > {
425
425
self . expr_as_place ( block, expr, Mutability :: Not , None )
426
426
}
427
427
428
428
fn expr_as_place (
429
429
& mut self ,
430
430
mut block : BasicBlock ,
431
- expr : & Expr < ' _ , ' tcx > ,
431
+ expr : & Expr < ' tcx > ,
432
432
mutability : Mutability ,
433
433
fake_borrow_temps : Option < & mut Vec < Local > > ,
434
434
) -> BlockAnd < PlaceBuilder < ' tcx > > {
@@ -440,23 +440,27 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
440
440
match expr. kind {
441
441
ExprKind :: Scope { region_scope, lint_level, value } => {
442
442
this. in_scope ( ( region_scope, source_info) , lint_level, |this| {
443
- this. expr_as_place ( block, value, mutability, fake_borrow_temps)
443
+ this. expr_as_place ( block, & this . thir [ value] , mutability, fake_borrow_temps)
444
444
} )
445
445
}
446
446
ExprKind :: Field { lhs, name } => {
447
- let place_builder =
448
- unpack ! ( block = this. expr_as_place( block, lhs, mutability, fake_borrow_temps, ) ) ;
447
+ let place_builder = unpack ! (
448
+ block =
449
+ this. expr_as_place( block, & this. thir[ lhs] , mutability, fake_borrow_temps, )
450
+ ) ;
449
451
block. and ( place_builder. field ( name, expr. ty ) )
450
452
}
451
453
ExprKind :: Deref { arg } => {
452
- let place_builder =
453
- unpack ! ( block = this. expr_as_place( block, arg, mutability, fake_borrow_temps, ) ) ;
454
+ let place_builder = unpack ! (
455
+ block =
456
+ this. expr_as_place( block, & this. thir[ arg] , mutability, fake_borrow_temps, )
457
+ ) ;
454
458
block. and ( place_builder. deref ( ) )
455
459
}
456
460
ExprKind :: Index { lhs, index } => this. lower_index_expression (
457
461
block,
458
- lhs,
459
- index,
462
+ & this . thir [ lhs] ,
463
+ & this . thir [ index] ,
460
464
mutability,
461
465
fake_borrow_temps,
462
466
expr. temp_lifetime ,
@@ -481,7 +485,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
481
485
482
486
ExprKind :: PlaceTypeAscription { source, user_ty } => {
483
487
let place_builder = unpack ! (
484
- block = this. expr_as_place( block, source, mutability, fake_borrow_temps, )
488
+ block = this. expr_as_place(
489
+ block,
490
+ & this. thir[ source] ,
491
+ mutability,
492
+ fake_borrow_temps,
493
+ )
485
494
) ;
486
495
if let Some ( user_ty) = user_ty {
487
496
let annotation_index =
@@ -509,6 +518,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
509
518
block. and ( place_builder)
510
519
}
511
520
ExprKind :: ValueTypeAscription { source, user_ty } => {
521
+ let source = & this. thir [ source] ;
512
522
let temp =
513
523
unpack ! ( block = this. as_temp( block, source. temp_lifetime, source, mutability) ) ;
514
524
if let Some ( user_ty) = user_ty {
@@ -613,8 +623,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
613
623
fn lower_index_expression (
614
624
& mut self ,
615
625
mut block : BasicBlock ,
616
- base : & Expr < ' _ , ' tcx > ,
617
- index : & Expr < ' _ , ' tcx > ,
626
+ base : & Expr < ' tcx > ,
627
+ index : & Expr < ' tcx > ,
618
628
mutability : Mutability ,
619
629
fake_borrow_temps : Option < & mut Vec < Local > > ,
620
630
temp_lifetime : Option < region:: Scope > ,
0 commit comments