@@ -603,7 +603,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
603
603
fn visit_statement_before_primary_effect (
604
604
& mut self ,
605
605
_results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
606
- state : & BorrowckDomain < ' a , ' tcx > ,
606
+ state : & BorrowckDomain ,
607
607
stmt : & ' a Statement < ' tcx > ,
608
608
location : Location ,
609
609
) {
@@ -677,7 +677,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
677
677
fn visit_terminator_before_primary_effect (
678
678
& mut self ,
679
679
_results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
680
- state : & BorrowckDomain < ' a , ' tcx > ,
680
+ state : & BorrowckDomain ,
681
681
term : & ' a Terminator < ' tcx > ,
682
682
loc : Location ,
683
683
) {
@@ -790,7 +790,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
790
790
fn visit_terminator_after_primary_effect (
791
791
& mut self ,
792
792
_results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
793
- state : & BorrowckDomain < ' a , ' tcx > ,
793
+ state : & BorrowckDomain ,
794
794
term : & ' a Terminator < ' tcx > ,
795
795
loc : Location ,
796
796
) {
@@ -983,7 +983,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
983
983
place_span : ( Place < ' tcx > , Span ) ,
984
984
kind : ( AccessDepth , ReadOrWrite ) ,
985
985
is_local_mutation_allowed : LocalMutationIsAllowed ,
986
- state : & BorrowckDomain < ' a , ' tcx > ,
986
+ state : & BorrowckDomain ,
987
987
) {
988
988
let ( sd, rw) = kind;
989
989
@@ -1032,7 +1032,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1032
1032
place_span : ( Place < ' tcx > , Span ) ,
1033
1033
sd : AccessDepth ,
1034
1034
rw : ReadOrWrite ,
1035
- state : & BorrowckDomain < ' a , ' tcx > ,
1035
+ state : & BorrowckDomain ,
1036
1036
) -> bool {
1037
1037
let mut error_reported = false ;
1038
1038
@@ -1172,7 +1172,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1172
1172
location : Location ,
1173
1173
place_span : ( Place < ' tcx > , Span ) ,
1174
1174
kind : AccessDepth ,
1175
- state : & BorrowckDomain < ' a , ' tcx > ,
1175
+ state : & BorrowckDomain ,
1176
1176
) {
1177
1177
// Write of P[i] or *P requires P init'd.
1178
1178
self . check_if_assigned_path_is_moved ( location, place_span, state) ;
@@ -1190,7 +1190,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1190
1190
& mut self ,
1191
1191
location : Location ,
1192
1192
( rvalue, span) : ( & ' a Rvalue < ' tcx > , Span ) ,
1193
- state : & BorrowckDomain < ' a , ' tcx > ,
1193
+ state : & BorrowckDomain ,
1194
1194
) {
1195
1195
match rvalue {
1196
1196
& Rvalue :: Ref ( _ /*rgn*/ , bk, place) => {
@@ -1448,7 +1448,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1448
1448
& mut self ,
1449
1449
location : Location ,
1450
1450
( operand, span) : ( & ' a Operand < ' tcx > , Span ) ,
1451
- state : & BorrowckDomain < ' a , ' tcx > ,
1451
+ state : & BorrowckDomain ,
1452
1452
) {
1453
1453
match * operand {
1454
1454
Operand :: Copy ( place) => {
@@ -1568,12 +1568,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1568
1568
}
1569
1569
}
1570
1570
1571
- fn check_activations (
1572
- & mut self ,
1573
- location : Location ,
1574
- span : Span ,
1575
- state : & BorrowckDomain < ' a , ' tcx > ,
1576
- ) {
1571
+ fn check_activations ( & mut self , location : Location , span : Span , state : & BorrowckDomain ) {
1577
1572
// Two-phase borrow support: For each activation that is newly
1578
1573
// generated at this statement, check if it interferes with
1579
1574
// another borrow.
@@ -1731,7 +1726,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1731
1726
location : Location ,
1732
1727
desired_action : InitializationRequiringAction ,
1733
1728
place_span : ( PlaceRef < ' tcx > , Span ) ,
1734
- state : & BorrowckDomain < ' a , ' tcx > ,
1729
+ state : & BorrowckDomain ,
1735
1730
) {
1736
1731
let maybe_uninits = & state. uninits ;
1737
1732
@@ -1836,7 +1831,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1836
1831
location : Location ,
1837
1832
desired_action : InitializationRequiringAction ,
1838
1833
place_span : ( PlaceRef < ' tcx > , Span ) ,
1839
- state : & BorrowckDomain < ' a , ' tcx > ,
1834
+ state : & BorrowckDomain ,
1840
1835
) {
1841
1836
let maybe_uninits = & state. uninits ;
1842
1837
@@ -1935,7 +1930,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
1935
1930
& mut self ,
1936
1931
location : Location ,
1937
1932
( place, span) : ( Place < ' tcx > , Span ) ,
1938
- state : & BorrowckDomain < ' a , ' tcx > ,
1933
+ state : & BorrowckDomain ,
1939
1934
) {
1940
1935
debug ! ( "check_if_assigned_path_is_moved place: {:?}" , place) ;
1941
1936
@@ -2001,7 +1996,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2001
1996
location : Location ,
2002
1997
base : PlaceRef < ' tcx > ,
2003
1998
span : Span ,
2004
- state : & BorrowckDomain < ' a , ' tcx > ,
1999
+ state : & BorrowckDomain ,
2005
2000
) {
2006
2001
// rust-lang/rust#21232: Until Rust allows reads from the
2007
2002
// initialized parts of partially initialized structs, we
@@ -2092,7 +2087,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2092
2087
( place, span) : ( Place < ' tcx > , Span ) ,
2093
2088
kind : ReadOrWrite ,
2094
2089
is_local_mutation_allowed : LocalMutationIsAllowed ,
2095
- state : & BorrowckDomain < ' a , ' tcx > ,
2090
+ state : & BorrowckDomain ,
2096
2091
location : Location ,
2097
2092
) -> bool {
2098
2093
debug ! (
@@ -2206,18 +2201,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
2206
2201
}
2207
2202
}
2208
2203
2209
- fn is_local_ever_initialized (
2210
- & self ,
2211
- local : Local ,
2212
- state : & BorrowckDomain < ' a , ' tcx > ,
2213
- ) -> Option < InitIndex > {
2204
+ fn is_local_ever_initialized ( & self , local : Local , state : & BorrowckDomain ) -> Option < InitIndex > {
2214
2205
let mpi = self . move_data . rev_lookup . find_local ( local) ?;
2215
2206
let ii = & self . move_data . init_path_map [ mpi] ;
2216
2207
ii. into_iter ( ) . find ( |& & index| state. ever_inits . contains ( index) ) . copied ( )
2217
2208
}
2218
2209
2219
2210
/// Adds the place into the used mutable variables set
2220
- fn add_used_mut ( & mut self , root_place : RootPlace < ' tcx > , state : & BorrowckDomain < ' a , ' tcx > ) {
2211
+ fn add_used_mut ( & mut self , root_place : RootPlace < ' tcx > , state : & BorrowckDomain ) {
2221
2212
match root_place {
2222
2213
RootPlace { place_local : local, place_projection : [ ] , is_local_mutation_allowed } => {
2223
2214
// If the local may have been initialized, and it is now currently being
0 commit comments