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