@@ -4,10 +4,11 @@ use crate::utils::{
44} ;
55use if_chain:: if_chain;
66use rustc:: declare_lint_pass;
7+ use rustc:: hir:: intravisit;
78use rustc:: hir:: intravisit:: * ;
8- use rustc:: hir:: * ;
99use rustc:: lint:: { LateContext , LateLintPass , LintArray , LintPass } ;
1010use rustc_errors:: Applicability ;
11+ use rustc_hir:: * ;
1112use rustc_session:: declare_tool_lint;
1213use rustc_span:: source_map:: Span ;
1314use syntax:: ast:: LitKind ;
@@ -109,7 +110,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
109110 // prevent folding of `cfg!` macros and the like
110111 if !e. span . from_expansion ( ) {
111112 match & e. kind {
112- ExprKind :: Unary ( UnNot , inner) => return Ok ( Bool :: Not ( box self . run ( inner) ?) ) ,
113+ ExprKind :: Unary ( UnOp :: UnNot , inner) => return Ok ( Bool :: Not ( box self . run ( inner) ?) ) ,
113114 ExprKind :: Binary ( binop, lhs, rhs) => match & binop. node {
114115 BinOpKind :: Or => return Ok ( Bool :: Or ( self . extract ( BinOpKind :: Or , & [ lhs, rhs] , Vec :: new ( ) ) ?) ) ,
115116 BinOpKind :: And => return Ok ( Bool :: And ( self . extract ( BinOpKind :: And , & [ lhs, rhs] , Vec :: new ( ) ) ?) ) ,
@@ -445,7 +446,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
445446 ExprKind :: Binary ( binop, _, _) if binop. node == BinOpKind :: Or || binop. node == BinOpKind :: And => {
446447 self . bool_expr ( e)
447448 } ,
448- ExprKind :: Unary ( UnNot , inner) => {
449+ ExprKind :: Unary ( UnOp :: UnNot , inner) => {
449450 if self . cx . tables . node_types ( ) [ inner. hir_id ] . is_bool ( ) {
450451 self . bool_expr ( e) ;
451452 } else {
@@ -471,7 +472,7 @@ struct NotSimplificationVisitor<'a, 'tcx> {
471472
472473impl < ' a , ' tcx > Visitor < ' tcx > for NotSimplificationVisitor < ' a , ' tcx > {
473474 fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
474- if let ExprKind :: Unary ( UnNot , inner) = & expr. kind {
475+ if let ExprKind :: Unary ( UnOp :: UnNot , inner) = & expr. kind {
475476 if let Some ( suggestion) = simplify_not ( self . cx , inner) {
476477 span_lint_and_sugg (
477478 self . cx ,
0 commit comments