Skip to content

Commit 3ea3638

Browse files
committed
Adjusted the suggestion text.
1 parent ff0453b commit 3ea3638

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,12 @@ impl BuildOutput {
737737
let new_syntax_added_in = RustVersion::from_str("1.77.0")?;
738738
if !new_syntax_added_in.is_compatible_with(msrv.as_partial()) {
739739
let old_syntax_suggestion = if has_reserved_prefix(flag) {
740-
format!("Consider using the old `cargo:` syntax in front of `{flag}`.\n")
740+
format!(
741+
"Switch to the old `cargo:{flag}` syntax (note the single colon).\n"
742+
)
741743
} else if flag.starts_with("metadata=") {
742744
let old_format_flag = flag.strip_prefix("metadata=").unwrap();
743-
format!("Consider using the old `cargo:{old_format_flag}` syntax instead of `cargo::{flag}` (note the single colon).\n")
745+
format!("Switch to the old `cargo:{old_format_flag}` syntax instead of `cargo::{flag}` (note the single colon).\n")
744746
} else {
745747
String::new()
746748
};

tests/testsuite/build_script.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5501,7 +5501,7 @@ fn test_new_syntax_with_old_msrv() {
55015501
[COMPILING] foo [..]
55025502
[ERROR] the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
55035503
but the minimum supported Rust version of `foo v0.5.0 ([ROOT]/foo)` is 1.60.0.
5504-
Consider using the old `cargo:foo=bar` syntax instead of `cargo::metadata=foo=bar` (note the single colon).
5504+
Switch to the old `cargo:foo=bar` syntax instead of `cargo::metadata=foo=bar` (note the single colon).
55055505
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
55065506
for more information about build script outputs.
55075507
",
@@ -5542,7 +5542,7 @@ fn test_new_syntax_with_old_msrv_and_reserved_prefix() {
55425542
[COMPILING] foo [..]
55435543
[ERROR] the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
55445544
but the minimum supported Rust version of `foo v0.5.0 ([ROOT]/foo)` is 1.60.0.
5545-
Consider using the old `cargo:` syntax in front of `rustc-check-cfg=cfg(foo)`.
5545+
Switch to the old `cargo:rustc-check-cfg=cfg(foo)` syntax (note the single colon).
55465546
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
55475547
for more information about build script outputs.
55485548
",

0 commit comments

Comments
 (0)