From 82592743f31525a223510fd897cfab96b6540f13 Mon Sep 17 00:00:00 2001 From: malyok <72450013+malyok99@users.noreply.github.com> Date: Sat, 11 Jan 2025 19:03:14 -0700 Subject: [PATCH] Update lib.rs fixed the problem described on: https://github.com/rust-lang/rust/issues/135298 --- src/tools/lint-docs/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs index 8c7ff08ccd72c..2b640c27f8241 100644 --- a/src/tools/lint-docs/src/lib.rs +++ b/src/tools/lint-docs/src/lib.rs @@ -476,7 +476,13 @@ impl<'a> LintExtractor<'a> { // First try to find the messages with the `code` field set to our lint. let matches: Vec<_> = msgs .iter() - .filter(|msg| matches!(&msg["code"]["code"], serde_json::Value::String(s) if s==name)) + .filter(|msg| { + if let Some(rendered) = msg["rendered"].as_str() { + rendered.split_whitespace().any(|word| word == name) + } else { + false + } + }) .map(|msg| msg["rendered"].as_str().expect("rendered field should exist").to_string()) .collect(); if matches.is_empty() {