@@ -1723,13 +1723,13 @@ impl<'tcx> Visitor<'tcx> for UsedVisitor {
1723
1723
}
1724
1724
}
1725
1725
1726
- struct LocalUsedVisitor < ' a , ' tcx : ' a > {
1726
+ struct LocalUsedVisitor < ' a , ' tcx > {
1727
1727
cx : & ' a LateContext < ' a , ' tcx > ,
1728
1728
local : HirId ,
1729
1729
used : bool ,
1730
1730
}
1731
1731
1732
- impl < ' a , ' tcx : ' a > Visitor < ' tcx > for LocalUsedVisitor < ' a , ' tcx > {
1732
+ impl < ' a , ' tcx > Visitor < ' tcx > for LocalUsedVisitor < ' a , ' tcx > {
1733
1733
fn visit_expr ( & mut self , expr : & ' tcx Expr ) {
1734
1734
if same_var ( self . cx , expr, self . local ) {
1735
1735
self . used = true ;
@@ -1743,7 +1743,7 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for LocalUsedVisitor<'a, 'tcx> {
1743
1743
}
1744
1744
}
1745
1745
1746
- struct VarVisitor < ' a , ' tcx : ' a > {
1746
+ struct VarVisitor < ' a , ' tcx > {
1747
1747
/// context reference
1748
1748
cx : & ' a LateContext < ' a , ' tcx > ,
1749
1749
/// var name to look for as index
@@ -1914,7 +1914,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1914
1914
}
1915
1915
}
1916
1916
1917
- fn is_used_inside < ' a , ' tcx : ' a > ( cx : & ' a LateContext < ' a , ' tcx > , expr : & ' tcx Expr , container : & ' tcx Expr ) -> bool {
1917
+ fn is_used_inside < ' a , ' tcx > ( cx : & ' a LateContext < ' a , ' tcx > , expr : & ' tcx Expr , container : & ' tcx Expr ) -> bool {
1918
1918
let def_id = match var_def_id ( cx, expr) {
1919
1919
Some ( id) => id,
1920
1920
None => return false ,
@@ -1927,7 +1927,7 @@ fn is_used_inside<'a, 'tcx: 'a>(cx: &'a LateContext<'a, 'tcx>, expr: &'tcx Expr,
1927
1927
false
1928
1928
}
1929
1929
1930
- fn is_iterator_used_after_while_let < ' a , ' tcx : ' a > ( cx : & LateContext < ' a , ' tcx > , iter_expr : & ' tcx Expr ) -> bool {
1930
+ fn is_iterator_used_after_while_let < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , iter_expr : & ' tcx Expr ) -> bool {
1931
1931
let def_id = match var_def_id ( cx, iter_expr) {
1932
1932
Some ( id) => id,
1933
1933
None => return false ,
@@ -1945,7 +1945,7 @@ fn is_iterator_used_after_while_let<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, it
1945
1945
visitor. var_used_after_while_let
1946
1946
}
1947
1947
1948
- struct VarUsedAfterLoopVisitor < ' a , ' tcx : ' a > {
1948
+ struct VarUsedAfterLoopVisitor < ' a , ' tcx > {
1949
1949
cx : & ' a LateContext < ' a , ' tcx > ,
1950
1950
def_id : HirId ,
1951
1951
iter_expr_id : HirId ,
@@ -2051,7 +2051,7 @@ enum VarState {
2051
2051
}
2052
2052
2053
2053
/// Scan a for loop for variables that are incremented exactly once.
2054
- struct IncrementVisitor < ' a , ' tcx : ' a > {
2054
+ struct IncrementVisitor < ' a , ' tcx > {
2055
2055
cx : & ' a LateContext < ' a , ' tcx > , // context reference
2056
2056
states : FxHashMap < HirId , VarState > , // incremented variables
2057
2057
depth : u32 , // depth of conditional expressions
@@ -2105,7 +2105,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
2105
2105
}
2106
2106
2107
2107
/// Checks whether a variable is initialized to zero at the start of a loop.
2108
- struct InitializeVisitor < ' a , ' tcx : ' a > {
2108
+ struct InitializeVisitor < ' a , ' tcx > {
2109
2109
cx : & ' a LateContext < ' a , ' tcx > , // context reference
2110
2110
end_expr : & ' tcx Expr , // the for loop. Stop scanning here.
2111
2111
var_id : HirId ,
@@ -2374,7 +2374,7 @@ fn check_infinite_loop<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, cond: &'tcx Expr, e
2374
2374
/// Stops analysis if a function call is found
2375
2375
/// Note: In some cases such as `self`, there are no mutable annotation,
2376
2376
/// All variables definition IDs are collected
2377
- struct VarCollectorVisitor < ' a , ' tcx : ' a > {
2377
+ struct VarCollectorVisitor < ' a , ' tcx > {
2378
2378
cx : & ' a LateContext < ' a , ' tcx > ,
2379
2379
ids : FxHashSet < HirId > ,
2380
2380
def_ids : FxHashMap < def_id:: DefId , bool > ,
0 commit comments