@@ -4,10 +4,11 @@ use crate::utils::{
4
4
} ;
5
5
use if_chain:: if_chain;
6
6
use rustc:: declare_lint_pass;
7
+ use rustc:: hir:: intravisit;
7
8
use rustc:: hir:: intravisit:: * ;
8
- use rustc:: hir:: * ;
9
9
use rustc:: lint:: { LateContext , LateLintPass , LintArray , LintPass } ;
10
10
use rustc_errors:: Applicability ;
11
+ use rustc_hir:: * ;
11
12
use rustc_session:: declare_tool_lint;
12
13
use rustc_span:: source_map:: Span ;
13
14
use syntax:: ast:: LitKind ;
@@ -109,7 +110,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
109
110
// prevent folding of `cfg!` macros and the like
110
111
if !e. span . from_expansion ( ) {
111
112
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) ?) ) ,
113
114
ExprKind :: Binary ( binop, lhs, rhs) => match & binop. node {
114
115
BinOpKind :: Or => return Ok ( Bool :: Or ( self . extract ( BinOpKind :: Or , & [ lhs, rhs] , Vec :: new ( ) ) ?) ) ,
115
116
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> {
445
446
ExprKind :: Binary ( binop, _, _) if binop. node == BinOpKind :: Or || binop. node == BinOpKind :: And => {
446
447
self . bool_expr ( e)
447
448
} ,
448
- ExprKind :: Unary ( UnNot , inner) => {
449
+ ExprKind :: Unary ( UnOp :: UnNot , inner) => {
449
450
if self . cx . tables . node_types ( ) [ inner. hir_id ] . is_bool ( ) {
450
451
self . bool_expr ( e) ;
451
452
} else {
@@ -471,7 +472,7 @@ struct NotSimplificationVisitor<'a, 'tcx> {
471
472
472
473
impl < ' a , ' tcx > Visitor < ' tcx > for NotSimplificationVisitor < ' a , ' tcx > {
473
474
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 {
475
476
if let Some ( suggestion) = simplify_not ( self . cx , inner) {
476
477
span_lint_and_sugg (
477
478
self . cx ,
0 commit comments