diff --git a/src/cargo/ops/cargo_compile/mod.rs b/src/cargo/ops/cargo_compile/mod.rs index a89ea94f459..0ed8aa14532 100644 --- a/src/cargo/ops/cargo_compile/mod.rs +++ b/src/cargo/ops/cargo_compile/mod.rs @@ -234,14 +234,14 @@ pub fn create_bcx<'a, 'gctx>( | CompileMode::RunCustomBuild => { if ws.gctx().get_env("RUST_FLAGS").is_ok() { gctx.shell().warn( - "Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`?", + "Ignoring incorrect environment variable `RUST_FLAGS`; Rust flags are passed via `RUSTFLAGS`.", )?; } } CompileMode::Doc { .. } | CompileMode::Doctest | CompileMode::Docscrape => { if ws.gctx().get_env("RUSTDOC_FLAGS").is_ok() { gctx.shell().warn( - "Cargo does not read `RUSTDOC_FLAGS` environment variable. Did you mean `RUSTDOCFLAGS`?" + "Ignoring incorrect environment variable `RUSTDOC_FLAGS`; Rust flags are passed via `RUSTDOCFLAGS`." )?; } } diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index bf10f81fc20..d1db236fbcb 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -863,8 +863,8 @@ impl<'gctx> Source for RegistrySource<'gctx> { // Attempt to handle misspellings by searching for a chain of related // names to the original name. The resolver will later // reject any candidates that have the wrong name, and with this it'll - // along the way produce helpful "did you mean?" suggestions. - // For now we only try the canonical lysing `-` to `_` and vice versa. + // have enough information to offer "a similar crate exists" suggestions. + // For now we only try canonicalizing `-` to `_` and vice versa. // More advanced fuzzy searching become in the future. for name_permutation in [ dep.package_name().replace('-', "_"), diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 9459fc6c37b..75e01506b33 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -1701,8 +1701,8 @@ pub fn to_real_manifest( if summary.features().contains_key("default-features") { warnings.push( - "`default-features = [\"..\"]` was found in [features]. \ - Did you mean to use `default = [\"..\"]`?" + "`[features]` defines a feature named `default-features`. \ + Note that only a feature named `default` will be enabled by default." .to_string(), ) } diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index 94a69cc6e11..9d9111f1737 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -1766,7 +1766,7 @@ fn warn_if_default_features() { .build(); p.cargo("check").with_stderr_data(str![[r#" -[WARNING] `default-features = [".."]` was found in [features]. Did you mean to use `default = [".."]`? +[WARNING] `[features]` defines a feature named `default-features`. Note that only a feature named `default` will be enabled by default. [LOCKING] 1 package to latest compatible version [CHECKING] foo v0.0.1 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s diff --git a/tests/testsuite/rustdocflags.rs b/tests/testsuite/rustdocflags.rs index c0692023154..e90afd79ba2 100644 --- a/tests/testsuite/rustdocflags.rs +++ b/tests/testsuite/rustdocflags.rs @@ -115,7 +115,7 @@ fn rustdocflags_misspelled() { p.cargo("doc") .env("RUSTDOC_FLAGS", "foo") .with_stderr_data(str![[r#" -[WARNING] Cargo does not read `RUSTDOC_FLAGS` environment variable. Did you mean `RUSTDOCFLAGS`? +[WARNING] Ignoring incorrect environment variable `RUSTDOC_FLAGS`; Rust flags are passed via `RUSTDOCFLAGS`. ... "#]]) .run(); diff --git a/tests/testsuite/rustflags.rs b/tests/testsuite/rustflags.rs index 195d7a07fea..f538669f57a 100644 --- a/tests/testsuite/rustflags.rs +++ b/tests/testsuite/rustflags.rs @@ -1471,7 +1471,7 @@ fn env_rustflags_misspelled_build_script() { p.cargo("check") .env("RUST_FLAGS", "foo") .with_stderr_data(str![[r#" -[WARNING] Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`? +[WARNING] Ignoring incorrect environment variable `RUST_FLAGS`; Rust flags are passed via `RUSTFLAGS`. [COMPILING] foo v0.0.1 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s