@@ -83,9 +83,7 @@ pub struct NonminimalBool {
83
83
84
84
impl NonminimalBool {
85
85
pub fn new ( conf : & ' static Conf ) -> Self {
86
- Self {
87
- msrv : conf. msrv . clone ( ) ,
88
- }
86
+ Self { msrv : conf. msrv }
89
87
}
90
88
}
91
89
@@ -101,7 +99,7 @@ impl<'tcx> LateLintPass<'tcx> for NonminimalBool {
101
99
_: Span ,
102
100
_: LocalDefId ,
103
101
) {
104
- NonminimalBoolVisitor { cx, msrv : & self . msrv } . visit_body ( body) ;
102
+ NonminimalBoolVisitor { cx, msrv : self . msrv } . visit_body ( body) ;
105
103
}
106
104
107
105
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' tcx > ) {
@@ -118,8 +116,6 @@ impl<'tcx> LateLintPass<'tcx> for NonminimalBool {
118
116
_ => { } ,
119
117
}
120
118
}
121
-
122
- extract_msrv_attr ! ( LateContext ) ;
123
119
}
124
120
125
121
fn inverted_bin_op_eq_str ( op : BinOpKind ) -> Option < & ' static str > {
@@ -196,7 +192,7 @@ fn check_inverted_bool_in_condition(
196
192
) ;
197
193
}
198
194
199
- fn check_simplify_not ( cx : & LateContext < ' _ > , msrv : & Msrv , expr : & Expr < ' _ > ) {
195
+ fn check_simplify_not ( cx : & LateContext < ' _ > , msrv : Msrv , expr : & Expr < ' _ > ) {
200
196
if let ExprKind :: Unary ( UnOp :: Not , inner) = & expr. kind
201
197
&& !expr. span . from_expansion ( )
202
198
&& !inner. span . from_expansion ( )
@@ -232,7 +228,7 @@ fn check_simplify_not(cx: &LateContext<'_>, msrv: &Msrv, expr: &Expr<'_>) {
232
228
233
229
struct NonminimalBoolVisitor < ' a , ' tcx > {
234
230
cx : & ' a LateContext < ' tcx > ,
235
- msrv : & ' a Msrv ,
231
+ msrv : Msrv ,
236
232
}
237
233
238
234
use quine_mc_cluskey:: Bool ;
@@ -325,7 +321,7 @@ impl<'v> Hir2Qmm<'_, '_, 'v> {
325
321
struct SuggestContext < ' a , ' tcx , ' v > {
326
322
terminals : & ' v [ & ' v Expr < ' v > ] ,
327
323
cx : & ' a LateContext < ' tcx > ,
328
- msrv : & ' a Msrv ,
324
+ msrv : Msrv ,
329
325
output : String ,
330
326
}
331
327
@@ -395,7 +391,7 @@ impl SuggestContext<'_, '_, '_> {
395
391
}
396
392
}
397
393
398
- fn simplify_not ( cx : & LateContext < ' _ > , curr_msrv : & Msrv , expr : & Expr < ' _ > ) -> Option < String > {
394
+ fn simplify_not ( cx : & LateContext < ' _ > , curr_msrv : Msrv , expr : & Expr < ' _ > ) -> Option < String > {
399
395
match & expr. kind {
400
396
ExprKind :: Binary ( binop, lhs, rhs) => {
401
397
if !implements_ord ( cx, lhs) {
@@ -437,7 +433,9 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: &Msrv, expr: &Expr<'_>) -> Opti
437
433
. iter ( )
438
434
. copied ( )
439
435
. flat_map ( |( msrv, a, b) | vec ! [ ( msrv, a, b) , ( msrv, b, a) ] )
440
- . find ( |& ( msrv, a, _) | msrv. is_none_or ( |msrv| curr_msrv. meets ( msrv) ) && a == path. ident . name . as_str ( ) )
436
+ . find ( |& ( msrv, a, _) | {
437
+ msrv. is_none_or ( |msrv| curr_msrv. meets ( cx, msrv) ) && a == path. ident . name . as_str ( )
438
+ } )
441
439
. and_then ( |( _, _, neg_method) | {
442
440
let negated_args = args
443
441
. iter ( )
@@ -466,7 +464,7 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: &Msrv, expr: &Expr<'_>) -> Opti
466
464
}
467
465
}
468
466
469
- fn suggest ( cx : & LateContext < ' _ > , msrv : & Msrv , suggestion : & Bool , terminals : & [ & Expr < ' _ > ] ) -> String {
467
+ fn suggest ( cx : & LateContext < ' _ > , msrv : Msrv , suggestion : & Bool , terminals : & [ & Expr < ' _ > ] ) -> String {
470
468
let mut suggest_context = SuggestContext {
471
469
terminals,
472
470
cx,
0 commit comments