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