diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index da7d9c085044..ae355505738e 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -902,6 +902,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &write::WRITELN_EMPTY_STRING, &write::WRITE_LITERAL, &write::WRITE_WITH_NEWLINE, + &xor_used_as_pow::XOR_USED_AS_POW, &zero_div_zero::ZERO_DIVIDED_BY_ZERO, ]); // end register lints, do not remove this comment, it’s used in `update_lints` @@ -1800,6 +1801,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT), LintId::of(&unwrap::PANICKING_UNWRAP), LintId::of(&vec_resize_to_zero::VEC_RESIZE_TO_ZERO), + LintId::of(&xor_used_as_pow::XOR_USED_AS_POW), ]); store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![ diff --git a/clippy_lints/src/xor_used_as_pow.rs b/clippy_lints/src/xor_used_as_pow.rs index 8a573e940855..66631c5c2a30 100644 --- a/clippy_lints/src/xor_used_as_pow.rs +++ b/clippy_lints/src/xor_used_as_pow.rs @@ -1,10 +1,10 @@ use crate::utils::{span_lint_and_help, span_lint_and_sugg}; use if_chain::if_chain; -use rustc_session::{declare_lint_pass, declare_tool_lint}; -use rustc_ast::*; -use rustc_middle::lint::in_external_macro; -use rustc_lint::{EarlyContext, EarlyLintPass}; +use rustc_ast::{BinOpKind, Expr, ExprKind, LitKind}; use rustc_errors::Applicability; +use rustc_lint::{EarlyContext, EarlyLintPass}; +use rustc_middle::lint::in_external_macro; +use rustc_session::{declare_lint_pass, declare_tool_lint}; declare_clippy_lint! { /// **What it does:** Checks for use of `^` operator when exponentiation was intended.