]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/lint/context.rs
Duplicate lint specifications are always bug!
[rust.git] / src / librustc / lint / context.rs
index fa73a3c6c4628bb1ee29573913a7f0a44b4f10d7..002c3f662351450d9e797dfc1093f03a8a05d5e2 100644 (file)
@@ -218,16 +218,7 @@ fn push_pass<P: LintPass + ?Sized + 'static>(&mut self,
 
             let id = LintId::of(lint);
             if self.by_name.insert(lint.name_lower(), Id(id)).is_some() {
-                let msg = format!("duplicate specification of lint {}", lint.name_lower());
-                match (sess, from_plugin) {
-                    // We load builtin lints first, so a duplicate is a compiler bug.
-                    // Use early_error when handling -W help with no crate.
-                    (None, _) => early_error(config::ErrorOutputType::default(), &msg[..]),
-                    (Some(_), false) => bug!("{}", msg),
-
-                    // A duplicate name from a plugin is a user error.
-                    (Some(sess), true)  => sess.err(&msg[..]),
-                }
+                bug!("duplicate specification of lint {}", lint.name_lower())
             }
         }
     }
@@ -300,16 +291,7 @@ pub fn register_group(
         }
 
         if !new {
-            let msg = format!("duplicate specification of lint group {}", name);
-            match (sess, from_plugin) {
-                // We load builtin lints first, so a duplicate is a compiler bug.
-                // Use early_error when handling -W help with no crate.
-                (None, _) => early_error(config::ErrorOutputType::default(), &msg[..]),
-                (Some(_), false) => bug!("{}", msg),
-
-                // A duplicate name from a plugin is a user error.
-                (Some(sess), true)  => sess.err(&msg[..]),
-            }
+            bug!("duplicate specification of lint group {}", name);
         }
     }