]> git.lizzy.rs Git - rust.git/commitdiff
Fix of bug introduced by #53762
authorflip1995 <9744647+flip1995@users.noreply.github.com>
Sat, 1 Sep 2018 15:43:14 +0000 (17:43 +0200)
committerflip1995 <9744647+flip1995@users.noreply.github.com>
Sat, 1 Sep 2018 15:43:14 +0000 (17:43 +0200)
src/librustc/lint/context.rs

index d5247b4ce9de85b68b7543ed19dafa09e656cc46..ddd74813621a80bc991189e064589eaf0a22843b 100644 (file)
@@ -319,7 +319,15 @@ pub fn check_lint_name_cmdline(&self,
             CheckLintNameResult::NoLint => {
                 Some(struct_err!(sess, E0602, "unknown lint: `{}`", lint_name))
             }
-            CheckLintNameResult::Tool(_) => unreachable!(),
+            CheckLintNameResult::Tool(result) => match result {
+                Err((Some(_), new_name)) => Some(sess.struct_warn(&format!(
+                    "lint name `{}` is deprcated \
+                     and does not have an effect anymore. \
+                     Use: {}",
+                    lint_name, new_name
+                ))),
+                _ => None,
+            },
         };
 
         if let Some(mut db) = db {