Access items through rustc_session instead of rustc_lint_defs

Items such as the `declare_tool_lint!()` macro are publicly reexported
from `rustc_lint_defs` to `rustc_session`. Use the latter for
consistency.
This commit is contained in:
Samuel Tardieu
2025-05-19 17:52:20 +02:00
parent ebc2a68fe8
commit e2b1de107f
11 changed files with 10 additions and 20 deletions
@@ -3,8 +3,7 @@
use regex::Regex;
use rustc_hir::{Attribute, Item, ItemKind, Mutability};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_session::impl_lint_pass;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_tool_lint! {
/// ### What it does
@@ -4,8 +4,7 @@
use rustc_errors::Applicability;
use rustc_hir::{Closure, Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
use std::borrow::{Borrow, Cow};
@@ -8,9 +8,8 @@
AttrArgs, AttrItem, AttrPath, Attribute, HirId, Impl, Item, ItemKind, Path, QPath, TraitRef, Ty, TyKind,
};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_middle::ty::TyCtxt;
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::sym;
declare_tool_lint! {
-1
View File
@@ -25,7 +25,6 @@
extern crate rustc_errors;
extern crate rustc_hir;
extern crate rustc_lint;
extern crate rustc_lint_defs;
extern crate rustc_middle;
extern crate rustc_session;
extern crate rustc_span;
@@ -10,9 +10,8 @@
use rustc_hir::intravisit::Visitor;
use rustc_hir::{ExprKind, HirId, Item, MutTy, Mutability, Path, TyKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_middle::hir::nested_filter;
use rustc_session::impl_lint_pass;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Symbol;
use rustc_span::{Span, sym};
+1 -2
View File
@@ -4,9 +4,8 @@
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_lint_defs::declare_tool_lint;
use rustc_middle::ty::{self, EarlyBinder, GenericArgKind};
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_tool_lint! {
/// ### What it does
@@ -4,8 +4,7 @@
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol::Symbol;
declare_tool_lint! {
+1 -2
View File
@@ -1,8 +1,7 @@
use rustc_ast::ast::NodeId;
use rustc_ast::visit::FnKind;
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
use rustc_lint_defs::declare_tool_lint;
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
declare_tool_lint! {
+1 -2
View File
@@ -6,10 +6,9 @@
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{Expr, ExprKind, Lit, Node, Pat, PatExprKind, PatKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_middle::mir::ConstValue;
use rustc_middle::ty;
use rustc_session::impl_lint_pass;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, sym};
@@ -5,8 +5,8 @@
use rustc_hir::def_id::DefId;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint_defs::{declare_lint_pass, declare_tool_lint};
use rustc_middle::mir::ConstValue;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol::Symbol;
declare_tool_lint! {
@@ -1,8 +1,7 @@
use clippy_utils::diagnostics::span_lint;
use rustc_ast::ast::{Crate, ItemKind, ModKind};
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_lint_defs::declare_tool_lint;
use rustc_session::declare_lint_pass;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_tool_lint! {
/// ### What it does