]> git.lizzy.rs Git - rust.git/blobdiff - tests/lint_message_convention.rs
Fix `manual_map` at the end of an if chain
[rust.git] / tests / lint_message_convention.rs
index e316a884996d4a43373db8dc87030356f3bcadb5..3f754c255b749b2ff2687ceb70252c6beacc1e8f 100644 (file)
@@ -28,12 +28,10 @@ fn new(path: PathBuf) -> Self {
         ])
         .unwrap();
 
-        // sometimes the first character is capitalized and it is legal (like in "Iterator...") or
+        // sometimes the first character is capitalized and it is legal (like in "C-like enum variants") or
         // we want to ask a question ending in "?"
         let exceptions_set: RegexSet = RegexSet::new(&[
-            r".*error: I see you're using a LinkedList! Perhaps you meant some other data structure?",
             r".*C-like enum variant discriminant is not portable to 32-bit targets",
-            r".*Iterator::step_by(0) will panic at runtime",
             r".*did you mean `unix`?",
             r".*the arguments may be inverted...",
             r".*Intel x86 assembly syntax used",
@@ -41,8 +39,6 @@ fn new(path: PathBuf) -> Self {
             r".*remove .*the return type...",
             r"note: Clippy version: .*",
             r"the compiler unexpectedly panicked. this is a bug.",
-            r".*help: I think you meant: .*",
-            r"Iterator.* will panic at runtime",
         ])
         .unwrap();
 
@@ -60,6 +56,11 @@ fn new(path: PathBuf) -> Self {
 
 #[test]
 fn lint_message_convention() {
+    // disable the test inside the rustc test suite
+    if option_env!("RUSTC_TEST_SUITE").is_some() {
+        return;
+    }
+
     // make sure that lint messages:
     // * are not capitalized
     // * don't have puncuation at the end of the last sentence
@@ -97,7 +98,9 @@ fn lint_message_convention() {
         eprintln!("\n\n");
     });
 
-    eprintln!("\n\n\nLint message should not start with a capital letter and should not have punctuation at the end of the message unless multiple sentences are needed.");
+    eprintln!(
+        "\n\n\nLint message should not start with a capital letter and should not have punctuation at the end of the message unless multiple sentences are needed."
+    );
     eprintln!("Check out the rustc-dev-guide for more information:");
     eprintln!("https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure\n\n\n");