@@ -381,7 +381,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
381381 crate fn as_place (
382382 & mut self ,
383383 mut block : BasicBlock ,
384- expr : & Expr < ' _ , ' tcx > ,
384+ expr : & Expr < ' tcx > ,
385385 ) -> BlockAnd < Place < ' tcx > > {
386386 let place_builder = unpack ! ( block = self . as_place_builder( block, expr) ) ;
387387 block. and ( place_builder. into_place ( self . tcx , self . typeck_results ) )
@@ -392,7 +392,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
392392 crate fn as_place_builder (
393393 & mut self ,
394394 block : BasicBlock ,
395- expr : & Expr < ' _ , ' tcx > ,
395+ expr : & Expr < ' tcx > ,
396396 ) -> BlockAnd < PlaceBuilder < ' tcx > > {
397397 self . expr_as_place ( block, expr, Mutability :: Mut , None )
398398 }
@@ -405,7 +405,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
405405 crate fn as_read_only_place (
406406 & mut self ,
407407 mut block : BasicBlock ,
408- expr : & Expr < ' _ , ' tcx > ,
408+ expr : & Expr < ' tcx > ,
409409 ) -> BlockAnd < Place < ' tcx > > {
410410 let place_builder = unpack ! ( block = self . as_read_only_place_builder( block, expr) ) ;
411411 block. and ( place_builder. into_place ( self . tcx , self . typeck_results ) )
@@ -420,15 +420,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
420420 fn as_read_only_place_builder (
421421 & mut self ,
422422 block : BasicBlock ,
423- expr : & Expr < ' _ , ' tcx > ,
423+ expr : & Expr < ' tcx > ,
424424 ) -> BlockAnd < PlaceBuilder < ' tcx > > {
425425 self . expr_as_place ( block, expr, Mutability :: Not , None )
426426 }
427427
428428 fn expr_as_place (
429429 & mut self ,
430430 mut block : BasicBlock ,
431- expr : & Expr < ' _ , ' tcx > ,
431+ expr : & Expr < ' tcx > ,
432432 mutability : Mutability ,
433433 fake_borrow_temps : Option < & mut Vec < Local > > ,
434434 ) -> BlockAnd < PlaceBuilder < ' tcx > > {
@@ -440,23 +440,27 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
440440 match expr. kind {
441441 ExprKind :: Scope { region_scope, lint_level, value } => {
442442 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)
444444 } )
445445 }
446446 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+ ) ;
449451 block. and ( place_builder. field ( name, expr. ty ) )
450452 }
451453 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+ ) ;
454458 block. and ( place_builder. deref ( ) )
455459 }
456460 ExprKind :: Index { lhs, index } => this. lower_index_expression (
457461 block,
458- lhs,
459- index,
462+ & this . thir [ lhs] ,
463+ & this . thir [ index] ,
460464 mutability,
461465 fake_borrow_temps,
462466 expr. temp_lifetime ,
@@ -481,7 +485,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
481485
482486 ExprKind :: PlaceTypeAscription { source, user_ty } => {
483487 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+ )
485494 ) ;
486495 if let Some ( user_ty) = user_ty {
487496 let annotation_index =
@@ -509,6 +518,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
509518 block. and ( place_builder)
510519 }
511520 ExprKind :: ValueTypeAscription { source, user_ty } => {
521+ let source = & this. thir [ source] ;
512522 let temp =
513523 unpack ! ( block = this. as_temp( block, source. temp_lifetime, source, mutability) ) ;
514524 if let Some ( user_ty) = user_ty {
@@ -613,8 +623,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
613623 fn lower_index_expression (
614624 & mut self ,
615625 mut block : BasicBlock ,
616- base : & Expr < ' _ , ' tcx > ,
617- index : & Expr < ' _ , ' tcx > ,
626+ base : & Expr < ' tcx > ,
627+ index : & Expr < ' tcx > ,
618628 mutability : Mutability ,
619629 fake_borrow_temps : Option < & mut Vec < Local > > ,
620630 temp_lifetime : Option < region:: Scope > ,
0 commit comments