1
Fork 0

Remove rustc_lint_defs::lint_array

This commit is contained in:
DaniPopes 2023-09-28 16:00:38 +02:00
parent c01d8d238c
commit f1b7484160
No known key found for this signature in database
GPG key ID: 0F09640DDB7AC692
11 changed files with 23 additions and 36 deletions

View file

@ -785,16 +785,7 @@ macro_rules! declare_tool_lint {
);
}
/// Declares a static `LintArray` and return it as an expression.
#[macro_export]
macro_rules! lint_array {
($( $lint:expr ),* ,) => { lint_array!( $($lint),* ) };
($( $lint:expr ),*) => {{
vec![$($lint),*]
}}
}
pub type LintArray = Vec<&'static Lint>;
pub type LintVec = Vec<&'static Lint>;
pub trait LintPass {
fn name(&self) -> &'static str;
@ -808,7 +799,7 @@ macro_rules! impl_lint_pass {
fn name(&self) -> &'static str { stringify!($ty) }
}
impl $ty {
pub fn get_lints() -> $crate::LintArray { $crate::lint_array!($($lint),*) }
pub fn get_lints() -> $crate::LintVec { vec![$($lint),*] }
}
};
}