Skip to content

Commit dc93188

Browse files
committed
Make exhaustive_enums a late pass
1 parent f1ab302 commit dc93188

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clippy_lints/src/exhaustive_enums.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::utils::{snippet_opt, span_lint_and_help, span_lint_and_sugg};
22
use if_chain::if_chain;
3-
use rustc_ast::ast::{Item, ItemKind};
3+
use rustc_hir::{Item, ItemKind};
44
use rustc_errors::Applicability;
5-
use rustc_lint::{EarlyContext, EarlyLintPass};
5+
use rustc_lint::{LateContext, LateLintPass};
66
use rustc_session::{declare_lint_pass, declare_tool_lint};
77
use rustc_span::sym;
88

@@ -36,8 +36,8 @@ declare_clippy_lint! {
3636

3737
declare_lint_pass!(ExhaustiveEnums => [EXHAUSTIVE_ENUMS]);
3838

39-
impl EarlyLintPass for ExhaustiveEnums {
40-
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
39+
impl LateLintPass<'_> for ExhaustiveEnums {
40+
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
4141
if_chain! {
4242
if let ItemKind::Enum(..) = item.kind;
4343
if !item.attrs.iter().any(|a| a.has_name(sym::non_exhaustive));

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10981098
store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence);
10991099
store.register_late_pass(|| box missing_doc::MissingDoc::new());
11001100
store.register_late_pass(|| box missing_inline::MissingInline);
1101-
store.register_early_pass(move || box exhaustive_enums::ExhaustiveEnums);
1101+
store.register_late_pass(move || box exhaustive_enums::ExhaustiveEnums);
11021102
store.register_late_pass(|| box if_let_some_result::OkIfLet);
11031103
store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl);
11041104
store.register_late_pass(|| box unused_io_amount::UnusedIoAmount);

0 commit comments

Comments
 (0)