Skip to content

Commit fbefae5

Browse files
GuillaumeGomezojeda
authored andcommitted
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]>
1 parent 562cc3c commit fbefae5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/rustdoc_test_gen.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: &
8787

8888
assert!(
8989
valid_paths.len() > 0,
90-
"No path candidates found. This is likely a bug in the build system, or some files went \
91-
away while compiling."
90+
"No path candidates found for `{file}`. This is likely a bug in the build system, or some \
91+
files went away while compiling."
9292
);
9393

9494
if valid_paths.len() > 1 {
@@ -97,8 +97,8 @@ fn find_real_path<'a>(srctree: &Path, valid_paths: &'a mut Vec<PathBuf>, file: &
9797
eprintln!(" {path:?}");
9898
}
9999
panic!(
100-
"Several path candidates found, please resolve the ambiguity by renaming a file or \
101-
folder."
100+
"Several path candidates found for `{file}`, please resolve the ambiguity by renaming \
101+
a file or folder."
102102
);
103103
}
104104

0 commit comments

Comments
 (0)