]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/lib.rs
Auto merge of #29291 - petrochenkov:privacy, r=alexcrichton
[rust.git] / src / librustc_lint / lib.rs
index 5338316406063ad3cd67482211de21d447e6eda0..920e0341372ba6afa47896911eecb46a6520669e 100644 (file)
@@ -35,7 +35,6 @@
 #![feature(box_syntax)]
 #![feature(num_bits_bytes)]
 #![feature(quote)]
-#![feature(ref_slice)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_private)]
 #![feature(slice_patterns)]
@@ -48,6 +47,7 @@
 #[macro_use]
 extern crate log;
 extern crate rustc_front;
+extern crate rustc_back;
 
 pub use rustc::lint as lint;
 pub use rustc::metadata as metadata;
 use session::Session;
 use lint::LintId;
 
+mod bad_style;
 mod builtin;
+mod types;
+mod unused;
+
+use bad_style::*;
+use builtin::*;
+use types::*;
+use unused::*;
 
 /// Tell the `LintStore` about all the built-in lints (the ones
 /// defined in this crate and the ones defined in
@@ -67,7 +75,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
     macro_rules! add_builtin {
         ($sess:ident, $($name:ident),*,) => (
             {$(
-                store.register_late_pass($sess, false, box builtin::$name);
+                store.register_late_pass($sess, false, box $name);
                 )*}
             )
     }
@@ -75,7 +83,7 @@ macro_rules! add_builtin {
     macro_rules! add_early_builtin {
         ($sess:ident, $($name:ident),*,) => (
             {$(
-                store.register_early_pass($sess, false, box builtin::$name);
+                store.register_early_pass($sess, false, box $name);
                 )*}
             )
     }
@@ -83,14 +91,14 @@ macro_rules! add_early_builtin {
     macro_rules! add_builtin_with_new {
         ($sess:ident, $($name:ident),*,) => (
             {$(
-                store.register_late_pass($sess, false, box builtin::$name::new());
+                store.register_late_pass($sess, false, box $name::new());
                 )*}
             )
     }
 
     macro_rules! add_lint_group {
         ($sess:ident, $name:expr, $($lint:ident),*) => (
-            store.register_group($sess, false, $name, vec![$(LintId::of(builtin::$lint)),*]);
+            store.register_group($sess, false, $name, vec![$(LintId::of($lint)),*]);
             )
     }
 
@@ -138,7 +146,7 @@ macro_rules! add_lint_group {
     add_lint_group!(sess, "unused",
                     UNUSED_IMPORTS, UNUSED_VARIABLES, UNUSED_ASSIGNMENTS, DEAD_CODE,
                     UNUSED_MUT, UNREACHABLE_CODE, UNUSED_MUST_USE,
-                    UNUSED_UNSAFE, PATH_STATEMENTS);
+                    UNUSED_UNSAFE, PATH_STATEMENTS, UNUSED_ATTRIBUTES);
 
     // We have one lint pass defined specially
     store.register_late_pass(sess, false, box lint::GatherNodeLevels);