aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/rustdoc_test_gen.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <[email protected]>2025-02-28 17:05:31 +0000
committerMiguel Ojeda <[email protected]>2025-03-08 22:02:12 +0000
commitfbefae55991f688f5f1615af30fe64823076b072 (patch)
tree60e4b77e16a61210baef1899dee90cd5f55094d0 /scripts/rustdoc_test_gen.rs
parentdocs: rust: Add error handling sections (diff)
downloadkernel-fbefae55991f688f5f1615af30fe64823076b072.tar.gz
kernel-fbefae55991f688f5f1615af30fe64823076b072.zip
scripts: rust: mention file name in error messages
Improve two error messages in the script by mentioning the doctest file path from which the doctest was generated from. This will allow, in case the conversion fails, to get directly the file name triggering the issue, making the bug fixing process faster. Signed-off-by: Guillaume Gomez <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded and removed an unneeded added parameter comma. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_gen.rs')
-rw-r--r--scripts/rustdoc_test_gen.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/rustdoc_test_gen.rs b/scripts/rustdoc_test_gen.rs
index 5ebd42ae4a3f..036635fb1621 100644
--- a/scripts/rustdoc_test_gen.rs
+++ b/scripts/rustdoc_test_gen.rs
@@ -87,8 +87,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: &
assert!(
valid_paths.len() > 0,
- "No path candidates found. This is likely a bug in the build system, or some files went \
- away while compiling."
+ "No path candidates found for `{file}`. This is likely a bug in the build system, or some \
+ files went away while compiling."
);
if valid_paths.len() > 1 {
@@ -97,8 +97,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: &
eprintln!(" {path:?}");
}
panic!(
- "Several path candidates found, please resolve the ambiguity by renaming a file or \
- folder."
+ "Several path candidates found for `{file}`, please resolve the ambiguity by renaming \
+ a file or folder."
);
}