]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/lint/context.rs
Lints being from a plugin is dependent on the lint, not the registration
[rust.git] / src / librustc / lint / context.rs
index c21c45b759c63d671218e2172bbe62a3b982d738..37f577da8bba22669b6a6fca74dd6305ac0082cc 100644 (file)
@@ -50,7 +50,7 @@
 pub struct LintStore {
     /// Registered lints. The bool is true if the lint was
     /// added by a plugin.
-    lints: Vec<(&'static Lint, bool)>,
+    lints: Vec<&'static Lint>,
 
     /// Trait objects for each lint pass.
     /// This is only `None` while performing a lint pass.
@@ -152,7 +152,7 @@ pub fn new() -> LintStore {
         }
     }
 
-    pub fn get_lints<'t>(&'t self) -> &'t [(&'static Lint, bool)] {
+    pub fn get_lints<'t>(&'t self) -> &'t [&'static Lint] {
         &self.lints
     }
 
@@ -169,10 +169,9 @@ pub fn get_lint_groups<'t>(&'t self) -> Vec<(&'static str, Vec<LintId>, bool)> {
     }
 
     pub fn register_early_pass(&mut self,
-                               from_plugin: bool,
                                register_only: bool,
                                pass: EarlyLintPassObject) {
-        self.push_lints(from_plugin, &pass.get_lints());
+        self.push_lints(&pass.get_lints());
         if !register_only {
             self.early_passes.as_mut().unwrap().push(pass);
         }
@@ -180,22 +179,20 @@ pub fn register_early_pass(&mut self,
 
     pub fn register_pre_expansion_pass(
         &mut self,
-        from_plugin: bool,
         register_only: bool,
         pass: EarlyLintPassObject,
     ) {
-        self.push_lints(from_plugin, &pass.get_lints());
+        self.push_lints(&pass.get_lints());
         if !register_only {
             self.pre_expansion_passes.as_mut().unwrap().push(pass);
         }
     }
 
     pub fn register_late_pass(&mut self,
-                              from_plugin: bool,
                               register_only: bool,
                               per_module: bool,
                               pass: LateLintPassObject) {
-        self.push_lints(from_plugin, &pass.get_lints());
+        self.push_lints(&pass.get_lints());
         if !register_only {
             if per_module {
                 self.late_module_passes.push(pass);
@@ -206,9 +203,9 @@ pub fn register_late_pass(&mut self,
     }
 
     // Helper method for register_early/late_pass
-    fn push_lints(&mut self, from_plugin: bool, lints: &[&'static Lint]) {
+    fn push_lints(&mut self, lints: &[&'static Lint]) {
         for lint in lints {
-            self.lints.push((lint, from_plugin));
+            self.lints.push(lint);
 
             let id = LintId::of(lint);
             if self.by_name.insert(lint.name_lower(), Id(id)).is_some() {