@@ -85,9 +85,7 @@ pub struct NonminimalBool {
8585
8686impl NonminimalBool {
8787 pub fn new ( conf : & ' static Conf ) -> Self {
88- Self {
89- msrv : conf. msrv . clone ( ) ,
90- }
88+ Self { msrv : conf. msrv }
9189 }
9290}
9391
@@ -103,7 +101,7 @@ impl<'tcx> LateLintPass<'tcx> for NonminimalBool {
103101 _: Span ,
104102 _: LocalDefId ,
105103 ) {
106- NonminimalBoolVisitor { cx, msrv : & self . msrv } . visit_body ( body) ;
104+ NonminimalBoolVisitor { cx, msrv : self . msrv } . visit_body ( body) ;
107105 }
108106
109107 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' tcx > ) {
@@ -120,8 +118,6 @@ impl<'tcx> LateLintPass<'tcx> for NonminimalBool {
120118 _ => { } ,
121119 }
122120 }
123-
124- extract_msrv_attr ! ( LateContext ) ;
125121}
126122
127123fn inverted_bin_op_eq_str ( op : BinOpKind ) -> Option < & ' static str > {
@@ -198,7 +194,7 @@ fn check_inverted_bool_in_condition(
198194 ) ;
199195}
200196
201- fn check_simplify_not ( cx : & LateContext < ' _ > , msrv : & Msrv , expr : & Expr < ' _ > ) {
197+ fn check_simplify_not ( cx : & LateContext < ' _ > , msrv : Msrv , expr : & Expr < ' _ > ) {
202198 if let ExprKind :: Unary ( UnOp :: Not , inner) = & expr. kind
203199 && !expr. span . from_expansion ( )
204200 && !inner. span . from_expansion ( )
@@ -234,7 +230,7 @@ fn check_simplify_not(cx: &LateContext<'_>, msrv: &Msrv, expr: &Expr<'_>) {
234230
235231struct NonminimalBoolVisitor < ' a , ' tcx > {
236232 cx : & ' a LateContext < ' tcx > ,
237- msrv : & ' a Msrv ,
233+ msrv : Msrv ,
238234}
239235
240236use quine_mc_cluskey:: Bool ;
@@ -327,7 +323,7 @@ impl<'v> Hir2Qmm<'_, '_, 'v> {
327323struct SuggestContext < ' a , ' tcx , ' v > {
328324 terminals : & ' v [ & ' v Expr < ' v > ] ,
329325 cx : & ' a LateContext < ' tcx > ,
330- msrv : & ' a Msrv ,
326+ msrv : Msrv ,
331327 output : String ,
332328}
333329
@@ -398,7 +394,7 @@ impl SuggestContext<'_, '_, '_> {
398394 }
399395}
400396
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 > {
402398 match & expr. kind {
403399 ExprKind :: Binary ( binop, lhs, rhs) => {
404400 if !implements_ord ( cx, lhs) {
@@ -440,7 +436,9 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: &Msrv, expr: &Expr<'_>) -> Opti
440436 . iter ( )
441437 . copied ( )
442438 . 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+ } )
444442 . and_then ( |( _, _, neg_method) | {
445443 let negated_args = args
446444 . iter ( )
@@ -469,7 +467,7 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: &Msrv, expr: &Expr<'_>) -> Opti
469467 }
470468}
471469
472- fn suggest ( cx : & LateContext < ' _ > , msrv : & Msrv , suggestion : & Bool , terminals : & [ & Expr < ' _ > ] ) -> String {
470+ fn suggest ( cx : & LateContext < ' _ > , msrv : Msrv , suggestion : & Bool , terminals : & [ & Expr < ' _ > ] ) -> String {
473471 let mut suggest_context = SuggestContext {
474472 terminals,
475473 cx,
0 commit comments