Skip to content

Commit d8f63e8

Browse files
committed
Eliminate the last three "did you mean" warning phrasings
Inspired by #15138 , this eliminates the last three instances. Also rephrase a comment that implied the use of "did you mean" suggestions.
1 parent 84a38b9 commit d8f63e8

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/cargo/ops/cargo_compile/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ pub fn create_bcx<'a, 'gctx>(
234234
| CompileMode::RunCustomBuild => {
235235
if ws.gctx().get_env("RUST_FLAGS").is_ok() {
236236
gctx.shell().warn(
237-
"Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`?",
237+
"Ignoring incorrect environment variable `RUST_FLAGS`; Rust flags are passed via `RUSTFLAGS`.",
238238
)?;
239239
}
240240
}
241241
CompileMode::Doc { .. } | CompileMode::Doctest | CompileMode::Docscrape => {
242242
if ws.gctx().get_env("RUSTDOC_FLAGS").is_ok() {
243243
gctx.shell().warn(
244-
"Cargo does not read `RUSTDOC_FLAGS` environment variable. Did you mean `RUSTDOCFLAGS`?"
244+
"Ignoring incorrect environment variable `RUSTDOC_FLAGS`; Rust flags are passed via `RUSTDOCFLAGS`."
245245
)?;
246246
}
247247
}

src/cargo/sources/registry/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ impl<'gctx> Source for RegistrySource<'gctx> {
863863
// Attempt to handle misspellings by searching for a chain of related
864864
// names to the original name. The resolver will later
865865
// reject any candidates that have the wrong name, and with this it'll
866-
// along the way produce helpful "did you mean?" suggestions.
866+
// have enough information to offer "a similar crate exists" suggestions.
867867
// For now we only try the canonical lysing `-` to `_` and vice versa.
868868
// More advanced fuzzy searching become in the future.
869869
for name_permutation in [

src/cargo/util/toml/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,8 @@ pub fn to_real_manifest(
17011701

17021702
if summary.features().contains_key("default-features") {
17031703
warnings.push(
1704-
"`default-features = [\"..\"]` was found in [features]. \
1705-
Did you mean to use `default = [\"..\"]`?"
1704+
"`[features]` defines a feature named `default-features`. \
1705+
Note that only a feature named `default` will be enabled by default."
17061706
.to_string(),
17071707
)
17081708
}

tests/testsuite/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,7 @@ fn warn_if_default_features() {
17661766
.build();
17671767

17681768
p.cargo("check").with_stderr_data(str![[r#"
1769-
[WARNING] `default-features = [".."]` was found in [features]. Did you mean to use `default = [".."]`?
1769+
[WARNING] `[features]` defines a feature named `default-features`. Note that only a feature named `default` will be enabled by default.
17701770
[LOCKING] 1 package to latest compatible version
17711771
[CHECKING] foo v0.0.1 ([ROOT]/foo)
17721772
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s

tests/testsuite/rustdocflags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn rustdocflags_misspelled() {
115115
p.cargo("doc")
116116
.env("RUSTDOC_FLAGS", "foo")
117117
.with_stderr_data(str![[r#"
118-
[WARNING] Cargo does not read `RUSTDOC_FLAGS` environment variable. Did you mean `RUSTDOCFLAGS`?
118+
[WARNING] Ignoring incorrect environment variable `RUSTDOC_FLAGS`; Rust flags are passed via `RUSTDOCFLAGS`.
119119
...
120120
"#]])
121121
.run();

tests/testsuite/rustflags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ fn env_rustflags_misspelled_build_script() {
14711471
p.cargo("check")
14721472
.env("RUST_FLAGS", "foo")
14731473
.with_stderr_data(str![[r#"
1474-
[WARNING] Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`?
1474+
[WARNING] Ignoring incorrect environment variable `RUST_FLAGS`; Rust flags are passed via `RUSTFLAGS`.
14751475
[COMPILING] foo v0.0.1 ([ROOT]/foo)
14761476
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
14771477

0 commit comments

Comments
 (0)