about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-05-27 16:56:57 +0200
committerflip1995 <hello@philkrones.com>2020-05-27 16:56:57 +0200
commit709ddba9fea4a4ba84883793df4f63c2f64a690a (patch)
treeff3b886fecaf6ff9683ae4c2df7934f8aaab14ad
parent783139bd8fc3b94fac9a1bf81bba2c506e8221b6 (diff)
downloadrust-709ddba9fea4a4ba84883793df4f63c2f64a690a.tar.gz
rust-709ddba9fea4a4ba84883793df4f63c2f64a690a.zip
Allow types (with lifetimes/generics) in impl_lint_pass
-rw-r--r--src/librustc_session/lint.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_session/lint.rs b/src/librustc_session/lint.rs
index b16d513d923..8a66fac1e36 100644
--- a/src/librustc_session/lint.rs
+++ b/src/librustc_session/lint.rs
@@ -347,14 +347,14 @@ pub trait LintPass {
     fn name(&self) -> &'static str;
 }
 
-/// Implements `LintPass for $name` with the given list of `Lint` statics.
+/// Implements `LintPass for $ty` with the given list of `Lint` statics.
 #[macro_export]
 macro_rules! impl_lint_pass {
-    ($name:ident => [$($lint:expr),* $(,)?]) => {
-        impl $crate::lint::LintPass for $name {
-            fn name(&self) -> &'static str { stringify!($name) }
+    ($ty:ty => [$($lint:expr),* $(,)?]) => {
+        impl $crate::lint::LintPass for $ty {
+            fn name(&self) -> &'static str { stringify!($ty) }
         }
-        impl $name {
+        impl $ty {
             pub fn get_lints() -> $crate::lint::LintArray { $crate::lint_array!($($lint),*) }
         }
     };