1
1
use rustc:: hir;
2
2
use rustc:: hir:: def_id:: DefId ;
3
- use rustc:: middle:: region:: ScopeTree ;
4
3
use rustc:: mir:: {
5
4
self , AggregateKind , BindingForm , BorrowKind , ClearCrossCrate , ConstraintCategory , Local ,
6
5
LocalDecl , LocalKind , Location , Operand , Place , PlaceBase , PlaceProjection ,
@@ -689,7 +688,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
689
688
) ;
690
689
691
690
let drop_span = place_span. 1 ;
692
- let scope_tree = self . infcx . tcx . region_scope_tree ( self . mir_def_id ) ;
693
691
let root_place = self . prefixes ( & borrow. borrowed_place , PrefixSet :: All )
694
692
. last ( )
695
693
. unwrap ( ) ;
@@ -791,15 +789,13 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
791
789
( Some ( name) , explanation) => self . report_local_value_does_not_live_long_enough (
792
790
location,
793
791
& name,
794
- & scope_tree,
795
792
& borrow,
796
793
drop_span,
797
794
borrow_spans,
798
795
explanation,
799
796
) ,
800
797
( None , explanation) => self . report_temporary_value_does_not_live_long_enough (
801
798
location,
802
- & scope_tree,
803
799
& borrow,
804
800
drop_span,
805
801
borrow_spans,
@@ -815,17 +811,16 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
815
811
& mut self ,
816
812
location : Location ,
817
813
name : & str ,
818
- scope_tree : & ' tcx ScopeTree ,
819
814
borrow : & BorrowData < ' tcx > ,
820
815
drop_span : Span ,
821
816
borrow_spans : UseSpans ,
822
817
explanation : BorrowExplanation ,
823
818
) -> DiagnosticBuilder < ' cx > {
824
819
debug ! (
825
820
"report_local_value_does_not_live_long_enough(\
826
- {:?}, {:?}, {:?}, {:?}, {:?}, {:?} \
821
+ {:?}, {:?}, {:?}, {:?}, {:?}\
827
822
)",
828
- location, name, scope_tree , borrow, drop_span, borrow_spans
823
+ location, name, borrow, drop_span, borrow_spans
829
824
) ;
830
825
831
826
let borrow_span = borrow_spans. var_or_use ( ) ;
@@ -1007,7 +1002,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1007
1002
fn report_temporary_value_does_not_live_long_enough (
1008
1003
& mut self ,
1009
1004
location : Location ,
1010
- scope_tree : & ' tcx ScopeTree ,
1011
1005
borrow : & BorrowData < ' tcx > ,
1012
1006
drop_span : Span ,
1013
1007
borrow_spans : UseSpans ,
@@ -1016,9 +1010,9 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
1016
1010
) -> DiagnosticBuilder < ' cx > {
1017
1011
debug ! (
1018
1012
"report_temporary_value_does_not_live_long_enough(\
1019
- {:?}, {:?}, {:?}, {:?}, {:?} \
1013
+ {:?}, {:?}, {:?}, {:?}\
1020
1014
)",
1021
- location, scope_tree , borrow, drop_span, proper_span
1015
+ location, borrow, drop_span, proper_span
1022
1016
) ;
1023
1017
1024
1018
if let BorrowExplanation :: MustBeValidFor {
0 commit comments