Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH 1/2] rust: doctest: fix incorrect pattern in replacement
@ 2026-06-13 14:04 Gary Guo
  2026-06-13 14:04 ` [PATCH 2/2] rust: doctest: trim function name for reproducbility Gary Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Guo @ 2026-06-13 14:04 UTC (permalink / raw)
  To: Brendan Higgins, David Gow, Rae Moar, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Greg Kroah-Hartman,
	Igor Korotin
  Cc: rust-for-linux, linux-kselftest, kunit-dev, linux-kernel

From: Gary Guo <gary@garyguo.net>

The `-> Result<(), impl core::fmt::Debug>` string is generated by rustdoc
and by adding "::" into the string it no longer finds anything, and making
the line useless. Remove the "::" in the pattern (but keep it in the
replacement result).

Fixes: de7cd3e4d638 ("rust: use absolute paths in macros referencing core and kernel")
Signed-off-by: Gary Guo <gary@garyguo.net>
---
 scripts/rustdoc_test_builder.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/rustdoc_test_builder.rs b/scripts/rustdoc_test_builder.rs
index f7540bcf595a..2b1f9ba01839 100644
--- a/scripts/rustdoc_test_builder.rs
+++ b/scripts/rustdoc_test_builder.rs
@@ -49,7 +49,7 @@ fn main() {
 
     // Qualify `Result` to avoid the collision with our own `Result` coming from the prelude.
     let body = body.replace(
-        &format!("{rustdoc_function_name}() -> Result<(), impl ::core::fmt::Debug> {{"),
+        &format!("{rustdoc_function_name}() -> Result<(), impl core::fmt::Debug> {{"),
         &format!(
             "{rustdoc_function_name}() -> ::core::result::Result<(), impl ::core::fmt::Debug> {{"
         ),

base-commit: abe651837cb394f76d738a7a747322fca3bf17ba
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-13 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-13 14:04 [PATCH 1/2] rust: doctest: fix incorrect pattern in replacement Gary Guo
2026-06-13 14:04 ` [PATCH 2/2] rust: doctest: trim function name for reproducbility Gary Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox