Skip to content

Commit 709ddba

Browse files
committed
Allow types (with lifetimes/generics) in impl_lint_pass
1 parent 783139b commit 709ddba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_session/lint.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ pub trait LintPass {
347347
fn name(&self) -> &'static str;
348348
}
349349

350-
/// Implements `LintPass for $name` with the given list of `Lint` statics.
350+
/// Implements `LintPass for $ty` with the given list of `Lint` statics.
351351
#[macro_export]
352352
macro_rules! impl_lint_pass {
353-
($name:ident => [$($lint:expr),* $(,)?]) => {
354-
impl $crate::lint::LintPass for $name {
355-
fn name(&self) -> &'static str { stringify!($name) }
353+
($ty:ty => [$($lint:expr),* $(,)?]) => {
354+
impl $crate::lint::LintPass for $ty {
355+
fn name(&self) -> &'static str { stringify!($ty) }
356356
}
357-
impl $name {
357+
impl $ty {
358358
pub fn get_lints() -> $crate::lint::LintArray { $crate::lint_array!($($lint),*) }
359359
}
360360
};

0 commit comments

Comments
 (0)