Skip to content

Commit c276457

Browse files
committed
fix(compile): Be consistent in not using period in error
Whether a period was used was dependent on whether a `help:` block is present. That shouldn't make a difference and the rustc dev guide says not to use periods unless multiple sentences are used.
1 parent 54dd94b commit c276457

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/cargo/ops/cargo_compile/unit_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl<'a> UnitGenerator<'a, '_> {
317317
} else {
318318
writeln!(
319319
msg,
320-
"no {target_desc} target {named} `{target_name}` in {unmatched_packages}.",
320+
"no {target_desc} target {named} `{target_name}` in {unmatched_packages}",
321321
)?;
322322

323323
append_targets_elsewhere(&mut msg, "")?;

tests/testsuite/build.rs

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

tests/testsuite/run.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ automatically infer them to be a target, such as in subfolders.
623623
624624
For more information on this warning you can consult
625625
https://github.com/rust-lang/cargo/issues/5330
626-
[ERROR] no example target named `a` in default-run packages.
626+
[ERROR] no example target named `a` in default-run packages
627627
Available example targets:
628628
do_magic
629629
@@ -655,7 +655,7 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
655655
p.cargo("run --example a")
656656
.with_status(101)
657657
.with_stderr_data(str![[r#"
658-
[ERROR] no example target named `a` in default-run packages.
658+
[ERROR] no example target named `a` in default-run packages
659659
Available example targets:
660660
do_magic
661661
@@ -743,7 +743,7 @@ fn run_with_filename() {
743743
p.cargo("run --bin bin.rs")
744744
.with_status(101)
745745
.with_stderr_data(str![[r#"
746-
[ERROR] no bin target named `bin.rs` in default-run packages.
746+
[ERROR] no bin target named `bin.rs` in default-run packages
747747
Available bin targets:
748748
a
749749
@@ -764,7 +764,7 @@ Available bin targets:
764764
p.cargo("run --example example.rs")
765765
.with_status(101)
766766
.with_stderr_data(str![[r#"
767-
[ERROR] no example target named `example.rs` in default-run packages.
767+
[ERROR] no example target named `example.rs` in default-run packages
768768
Available example targets:
769769
a
770770
@@ -847,7 +847,7 @@ fn ambiguous_bin_name() {
847847
p.cargo("run --bin crate1/ambiguous")
848848
.with_status(101)
849849
.with_stderr_data(str![[r#"
850-
[ERROR] no bin target named `crate1/ambiguous` in default-run packages.
850+
[ERROR] no bin target named `crate1/ambiguous` in default-run packages
851851
Available bin targets:
852852
ambiguous
853853
ambiguous
@@ -975,7 +975,7 @@ Available binaries:
975975
p.cargo("check --bin pattern*")
976976
.with_status(101)
977977
.with_stderr_data(str![[r#"
978-
[ERROR] no bin target matches pattern `pattern*` in default-run packages.
978+
[ERROR] no bin target matches pattern `pattern*` in default-run packages
979979
[HELP] Available bin in `pattern1` package:
980980
pattern1
981981
[HELP] Available bin in `pattern2` package:
@@ -1000,7 +1000,7 @@ Available binaries:
10001000
p.cargo("run --bin crate2")
10011001
.with_status(101)
10021002
.with_stderr_data(str![[r#"
1003-
[ERROR] no bin target named `crate2` in default-run packages.
1003+
[ERROR] no bin target named `crate2` in default-run packages
10041004
[HELP] Available bin in `crate2` package:
10051005
crate2
10061006

tests/testsuite/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,15 +2447,15 @@ fn bad_example() {
24472447
p.cargo("run --example foo")
24482448
.with_status(101)
24492449
.with_stderr_data(str![[r#"
2450-
[ERROR] no example target named `foo` in default-run packages.
2450+
[ERROR] no example target named `foo` in default-run packages
24512451
24522452
24532453
"#]])
24542454
.run();
24552455
p.cargo("run --bin foo")
24562456
.with_status(101)
24572457
.with_stderr_data(str![[r#"
2458-
[ERROR] no bin target named `foo` in default-run packages.
2458+
[ERROR] no bin target named `foo` in default-run packages
24592459
24602460
24612461
"#]])

0 commit comments

Comments
 (0)