Skip to content

Commit ad65326

Browse files
committed
Remove rustc_lint_defs::lint_array
1 parent c01d8d2 commit ad65326

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

compiler/rustc_lint/src/foreign_modules.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ use rustc_hir::def::DefKind;
55
use rustc_middle::query::Providers;
66
use rustc_middle::ty::layout::LayoutError;
77
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
8-
use rustc_session::lint::{lint_array, LintArray};
98
use rustc_span::{sym, Span, Symbol};
109
use rustc_target::abi::FIRST_VARIANT;
1110

1211
use crate::lints::{BuiltinClashingExtern, BuiltinClashingExternSub};
13-
use crate::types;
12+
use crate::{types, LintArray};
1413

1514
pub(crate) fn provide(providers: &mut Providers) {
1615
*providers = Providers { clashing_extern_declarations, ..*providers };
1716
}
1817

1918
pub(crate) fn get_lints() -> LintArray {
20-
lint_array!(CLASHING_EXTERN_DECLARATIONS)
19+
vec![CLASHING_EXTERN_DECLARATIONS]
2120
}
2221

2322
fn clashing_extern_declarations(tcx: TyCtxt<'_>, (): ()) {

compiler/rustc_lint_defs/src/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,6 @@ macro_rules! declare_tool_lint {
785785
);
786786
}
787787

788-
/// Declares a static `LintArray` and return it as an expression.
789-
#[macro_export]
790-
macro_rules! lint_array {
791-
($( $lint:expr ),* ,) => { lint_array!( $($lint),* ) };
792-
($( $lint:expr ),*) => {{
793-
vec![$($lint),*]
794-
}}
795-
}
796-
797788
pub type LintArray = Vec<&'static Lint>;
798789

799790
pub trait LintPass {
@@ -808,7 +799,7 @@ macro_rules! impl_lint_pass {
808799
fn name(&self) -> &'static str { stringify!($ty) }
809800
}
810801
impl $ty {
811-
pub fn get_lints() -> $crate::LintArray { $crate::lint_array!($($lint),*) }
802+
pub fn get_lints() -> $crate::LintArray { vec![$($lint),*] }
812803
}
813804
};
814805
}

src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ declare_clippy_lint! {
2828
/// know the name of the lint.
2929
///
3030
/// ### Known problems
31-
/// Only checks for lints associated using the
32-
/// `declare_lint_pass!`, `impl_lint_pass!`, and `lint_array!` macros.
31+
/// Only checks for lints associated using the `declare_lint_pass!` and
32+
/// `impl_lint_pass!` macros.
3333
///
3434
/// ### Example
3535
/// ```rust,ignore

0 commit comments

Comments
 (0)