@@ -75,12 +75,12 @@ struct NonminimalBoolVisitor<'a, 'tcx> {
75
75
76
76
use quine_mc_cluskey:: Bool ;
77
77
struct Hir2Qmm < ' a , ' tcx , ' v > {
78
- terminals : Vec < & ' v Expr > ,
78
+ terminals : Vec < & ' v Expr < ' v > > ,
79
79
cx : & ' a LateContext < ' a , ' tcx > ,
80
80
}
81
81
82
82
impl < ' a , ' tcx , ' v > Hir2Qmm < ' a , ' tcx , ' v > {
83
- fn extract ( & mut self , op : BinOpKind , a : & [ & ' v Expr ] , mut v : Vec < Bool > ) -> Result < Vec < Bool > , String > {
83
+ fn extract ( & mut self , op : BinOpKind , a : & [ & ' v Expr < ' _ > ] , mut v : Vec < Bool > ) -> Result < Vec < Bool > , String > {
84
84
for a in a {
85
85
if let ExprKind :: Binary ( binop, lhs, rhs) = & a. kind {
86
86
if binop. node == op {
@@ -93,7 +93,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
93
93
Ok ( v)
94
94
}
95
95
96
- fn run ( & mut self , e : & ' v Expr ) -> Result < Bool , String > {
96
+ fn run ( & mut self , e : & ' v Expr < ' _ > ) -> Result < Bool , String > {
97
97
fn negate ( bin_op_kind : BinOpKind ) -> Option < BinOpKind > {
98
98
match bin_op_kind {
99
99
BinOpKind :: Eq => Some ( BinOpKind :: Ne ) ,
@@ -154,7 +154,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
154
154
}
155
155
156
156
struct SuggestContext < ' a , ' tcx , ' v > {
157
- terminals : & ' v [ & ' v Expr ] ,
157
+ terminals : & ' v [ & ' v Expr < ' v > ] ,
158
158
cx : & ' a LateContext < ' a , ' tcx > ,
159
159
output : String ,
160
160
}
@@ -222,7 +222,7 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
222
222
}
223
223
}
224
224
225
- fn simplify_not ( cx : & LateContext < ' _ , ' _ > , expr : & Expr ) -> Option < String > {
225
+ fn simplify_not ( cx : & LateContext < ' _ , ' _ > , expr : & Expr < ' _ > ) -> Option < String > {
226
226
match & expr. kind {
227
227
ExprKind :: Binary ( binop, lhs, rhs) => {
228
228
if !implements_ord ( cx, lhs) {
@@ -266,7 +266,7 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
266
266
}
267
267
}
268
268
269
- fn suggest ( cx : & LateContext < ' _ , ' _ > , suggestion : & Bool , terminals : & [ & Expr ] ) -> String {
269
+ fn suggest ( cx : & LateContext < ' _ , ' _ > , suggestion : & Bool , terminals : & [ & Expr < ' _ > ] ) -> String {
270
270
let mut suggest_context = SuggestContext {
271
271
terminals,
272
272
cx,
@@ -332,7 +332,7 @@ fn terminal_stats(b: &Bool) -> Stats {
332
332
}
333
333
334
334
impl < ' a , ' tcx > NonminimalBoolVisitor < ' a , ' tcx > {
335
- fn bool_expr ( & self , e : & ' tcx Expr ) {
335
+ fn bool_expr ( & self , e : & ' tcx Expr < ' _ > ) {
336
336
let mut h2q = Hir2Qmm {
337
337
terminals : Vec :: new ( ) ,
338
338
cx : self . cx ,
@@ -437,7 +437,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
437
437
}
438
438
439
439
impl < ' a , ' tcx > Visitor < ' tcx > for NonminimalBoolVisitor < ' a , ' tcx > {
440
- fn visit_expr ( & mut self , e : & ' tcx Expr ) {
440
+ fn visit_expr ( & mut self , e : & ' tcx Expr < ' _ > ) {
441
441
if in_macro ( e. span ) {
442
442
return ;
443
443
}
@@ -460,7 +460,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
460
460
}
461
461
}
462
462
463
- fn implements_ord < ' a , ' tcx > ( cx : & ' a LateContext < ' a , ' tcx > , expr : & Expr ) -> bool {
463
+ fn implements_ord < ' a , ' tcx > ( cx : & ' a LateContext < ' a , ' tcx > , expr : & Expr < ' _ > ) -> bool {
464
464
let ty = cx. tables . expr_ty ( expr) ;
465
465
get_trait_def_id ( cx, & paths:: ORD ) . map_or ( false , |id| implements_trait ( cx, ty, id, & [ ] ) )
466
466
}
@@ -470,7 +470,7 @@ struct NotSimplificationVisitor<'a, 'tcx> {
470
470
}
471
471
472
472
impl < ' a , ' tcx > Visitor < ' tcx > for NotSimplificationVisitor < ' a , ' tcx > {
473
- fn visit_expr ( & mut self , expr : & ' tcx Expr ) {
473
+ fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
474
474
if let ExprKind :: Unary ( UnNot , inner) = & expr. kind {
475
475
if let Some ( suggestion) = simplify_not ( self . cx , inner) {
476
476
span_lint_and_sugg (
0 commit comments