Skip to content

Commit b20edd4

Browse files
committed
fix(compile): Consistently use help prefix in errors
1 parent 7bf7b2f commit b20edd4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/cargo/ops/cargo_compile/unit_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl<'a> UnitGenerator<'a, '_> {
314314
if !targets_elsewhere.is_empty() {
315315
append_targets_elsewhere(&mut msg)?;
316316
} else if suggestion.is_empty() && !targets.is_empty() {
317-
write!(msg, "\navailable {} targets:", target_desc)?;
317+
write!(msg, "\nhelp: available {} targets:", target_desc)?;
318318
for target in targets {
319319
write!(msg, "\n {}", target.name())?;
320320
}

tests/testsuite/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ fn cargo_compile_with_filename() {
13381338
.with_status(101)
13391339
.with_stderr_data(str![[r#"
13401340
[ERROR] no bin target named `bin.rs` in default-run packages
1341-
available bin targets:
1341+
[HELP] available bin targets:
13421342
a
13431343
13441344
"#]])
@@ -1358,7 +1358,7 @@ available bin targets:
13581358
.with_status(101)
13591359
.with_stderr_data(str![[r#"
13601360
[ERROR] no example target named `example.rs` in default-run packages
1361-
available example targets:
1361+
[HELP] available example targets:
13621362
a
13631363
13641364
"#]])

tests/testsuite/run.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ automatically infer them to be a target, such as in subfolders.
624624
For more information on this warning you can consult
625625
https://github.com/rust-lang/cargo/issues/5330
626626
[ERROR] no example target named `a` in default-run packages
627-
available example targets:
627+
[HELP] available example targets:
628628
do_magic
629629
630630
"#]])
@@ -655,7 +655,7 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
655655
.with_status(101)
656656
.with_stderr_data(str![[r#"
657657
[ERROR] no example target named `a` in default-run packages
658-
available example targets:
658+
[HELP] available example targets:
659659
do_magic
660660
661661
"#]])
@@ -742,7 +742,7 @@ fn run_with_filename() {
742742
.with_status(101)
743743
.with_stderr_data(str![[r#"
744744
[ERROR] no bin target named `bin.rs` in default-run packages
745-
available bin targets:
745+
[HELP] available bin targets:
746746
a
747747
748748
"#]])
@@ -762,7 +762,7 @@ available bin targets:
762762
.with_status(101)
763763
.with_stderr_data(str![[r#"
764764
[ERROR] no example target named `example.rs` in default-run packages
765-
available example targets:
765+
[HELP] available example targets:
766766
a
767767
768768
"#]])
@@ -844,7 +844,7 @@ fn ambiguous_bin_name() {
844844
.with_status(101)
845845
.with_stderr_data(str![[r#"
846846
[ERROR] no bin target named `crate1/ambiguous` in default-run packages
847-
available bin targets:
847+
[HELP] available bin targets:
848848
ambiguous
849849
ambiguous
850850
ambiguous

0 commit comments

Comments
 (0)