about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYudai Fukushima <49578068+granddaifuku@users.noreply.github.com>2024-01-04 13:49:33 +0000
committerGitHub <noreply@github.com>2024-01-04 13:49:33 +0000
commit9dcf92649cc3bf4b5152545286ef3be74c196fa4 (patch)
tree440770365505e0080ae46b31bd2333253b13b287
parent0bf0b88035563973405676601fde107b84ca3d0c (diff)
downloadrust-9dcf92649cc3bf4b5152545286ef3be74c196fa4.tar.gz
rust-9dcf92649cc3bf4b5152545286ef3be74c196fa4.zip
fix: metadata-collector listing lints when config documents include comma
-rw-r--r--clippy_config/src/conf.rs2
-rw-r--r--clippy_config/src/metadata.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs
index f88ab9fe440..5477d9b83a7 100644
--- a/clippy_config/src/conf.rs
+++ b/clippy_config/src/conf.rs
@@ -550,7 +550,7 @@ define_Conf! {
     /// Lint: PUB_UNDERSCORE_FIELDS
     ///
     /// Lint "public" fields in a struct that are prefixed with an underscore based on their
-    /// exported visibility; or whether they are marked as "pub".
+    /// exported visibility, or whether they are marked as "pub".
     (pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PublicallyExported),
 }
 
diff --git a/clippy_config/src/metadata.rs b/clippy_config/src/metadata.rs
index 2451fbc91e8..3ba2796e18d 100644
--- a/clippy_config/src/metadata.rs
+++ b/clippy_config/src/metadata.rs
@@ -96,6 +96,9 @@ fn parse_config_field_doc(doc_comment: &str) -> Option<(Vec<String>, String)> {
         doc_comment.make_ascii_lowercase();
         let lints: Vec<String> = doc_comment
             .split_off(DOC_START.len())
+            .lines()
+            .next()
+            .unwrap()
             .split(", ")
             .map(str::to_string)
             .collect();