fix(compile): Consistently use help prefix in errors

This commit is contained in:
Ed Page 2025-03-11 11:54:00 -05:00
parent 7bf7b2f684
commit b20edd4226
3 changed files with 8 additions and 8 deletions

View File

@ -314,7 +314,7 @@ impl<'a> UnitGenerator<'a, '_> {
if !targets_elsewhere.is_empty() {
append_targets_elsewhere(&mut msg)?;
} else if suggestion.is_empty() && !targets.is_empty() {
write!(msg, "\navailable {} targets:", target_desc)?;
write!(msg, "\nhelp: available {} targets:", target_desc)?;
for target in targets {
write!(msg, "\n {}", target.name())?;
}

View File

@ -1338,7 +1338,7 @@ fn cargo_compile_with_filename() {
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no bin target named `bin.rs` in default-run packages
available bin targets:
[HELP] available bin targets:
a
"#]])
@ -1358,7 +1358,7 @@ available bin targets:
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no example target named `example.rs` in default-run packages
available example targets:
[HELP] available example targets:
a
"#]])

View File

@ -624,7 +624,7 @@ automatically infer them to be a target, such as in subfolders.
For more information on this warning you can consult
https://github.com/rust-lang/cargo/issues/5330
[ERROR] no example target named `a` in default-run packages
available example targets:
[HELP] available example targets:
do_magic
"#]])
@ -655,7 +655,7 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no example target named `a` in default-run packages
available example targets:
[HELP] available example targets:
do_magic
"#]])
@ -742,7 +742,7 @@ fn run_with_filename() {
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no bin target named `bin.rs` in default-run packages
available bin targets:
[HELP] available bin targets:
a
"#]])
@ -762,7 +762,7 @@ available bin targets:
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no example target named `example.rs` in default-run packages
available example targets:
[HELP] available example targets:
a
"#]])
@ -844,7 +844,7 @@ fn ambiguous_bin_name() {
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] no bin target named `crate1/ambiguous` in default-run packages
available bin targets:
[HELP] available bin targets:
ambiguous
ambiguous
ambiguous