mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Fix some formatting for some strings.
This commit is contained in:
parent
0dd7c508d0
commit
a4e9611453
@ -1273,8 +1273,7 @@ fn resolving_but_no_exists() {
|
||||
|
||||
assert_eq!(
|
||||
res.err().unwrap().to_string(),
|
||||
"\
|
||||
no matching package named `foo` found\n\
|
||||
"no matching package named `foo` found\n\
|
||||
location searched: registry `https://example.com/`\n\
|
||||
required by package `root v1.0.0 (registry `https://example.com/`)`\
|
||||
"
|
||||
|
@ -31,8 +31,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
|
||||
let version = match args.value_of("format-version") {
|
||||
None => {
|
||||
config.shell().warn(
|
||||
"\
|
||||
please specify `--format-version` flag explicitly \
|
||||
"please specify `--format-version` flag explicitly \
|
||||
to avoid compatibility problems",
|
||||
)?;
|
||||
1
|
||||
|
@ -204,8 +204,7 @@ impl Package {
|
||||
let manifest = self.manifest().original().prepare_for_publish(config)?;
|
||||
let toml = toml::to_string(&manifest)?;
|
||||
Ok(format!(
|
||||
"\
|
||||
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO\n\
|
||||
"# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO\n\
|
||||
#\n\
|
||||
# When uploading crates to the registry Cargo will automatically\n\
|
||||
# \"normalize\" Cargo.toml files for maximal compatibility\n\
|
||||
|
@ -387,8 +387,7 @@ https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overridin
|
||||
continue;
|
||||
}
|
||||
let msg = format!(
|
||||
"\
|
||||
path override for crate `{}` has altered the original list of\n\
|
||||
"path override for crate `{}` has altered the original list of\n\
|
||||
dependencies; the dependency on `{}` was either added or\n\
|
||||
modified to not match the previously resolved version\n\n\
|
||||
{}",
|
||||
@ -402,10 +401,9 @@ https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overridin
|
||||
|
||||
if let Some(dep) = real_deps.get(0) {
|
||||
let msg = format!(
|
||||
"\
|
||||
path override for crate `{}` has altered the original list of
|
||||
dependencies; the dependency on `{}` was removed\n\n
|
||||
{}",
|
||||
"path override for crate `{}` has altered the original list of\n\
|
||||
dependencies; the dependency on `{}` was removed\n\n\
|
||||
{}",
|
||||
override_summary.package_id().name(),
|
||||
dep.package_name(),
|
||||
boilerplate
|
||||
|
@ -269,8 +269,7 @@ fn transmit(
|
||||
Ok(warnings) => {
|
||||
if !warnings.invalid_categories.is_empty() {
|
||||
let msg = format!(
|
||||
"\
|
||||
the following are not valid category slugs and were \
|
||||
"the following are not valid category slugs and were \
|
||||
ignored: {}. Please see https://crates.io/category_slugs \
|
||||
for the list of all category slugs. \
|
||||
",
|
||||
@ -281,8 +280,7 @@ fn transmit(
|
||||
|
||||
if !warnings.invalid_badges.is_empty() {
|
||||
let msg = format!(
|
||||
"\
|
||||
the following are not valid badges and were ignored: {}. \
|
||||
"the following are not valid badges and were ignored: {}. \
|
||||
Either the badge type specified is unknown or a required \
|
||||
attribute is missing. Please see \
|
||||
https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata \
|
||||
|
@ -176,8 +176,7 @@ impl<'cfg> Source for DirectorySource<'cfg> {
|
||||
.finish_hex();
|
||||
if &*actual != cksum {
|
||||
failure::bail!(
|
||||
"\
|
||||
the listed checksum of `{}` has changed:\n\
|
||||
"the listed checksum of `{}` has changed:\n\
|
||||
expected: {}\n\
|
||||
actual: {}\n\
|
||||
\n\
|
||||
|
@ -152,8 +152,7 @@ pub trait AppExt: Sized {
|
||||
self._arg(
|
||||
opt(
|
||||
"vcs",
|
||||
"\
|
||||
Initialize a new repository for the given version \
|
||||
"Initialize a new repository for the given version \
|
||||
control system (git, hg, pijul, or fossil) or do not \
|
||||
initialize any version control at all (none), overriding \
|
||||
a global configuration.",
|
||||
|
@ -18,8 +18,7 @@ use crate::util::{Config, ProcessBuilder};
|
||||
|
||||
const DIAGNOSICS_SERVER_VAR: &str = "__CARGO_FIX_DIAGNOSTICS_SERVER";
|
||||
const PLEASE_REPORT_THIS_BUG: &str =
|
||||
"\
|
||||
This likely indicates a bug in either rustc or cargo itself,\n\
|
||||
"This likely indicates a bug in either rustc or cargo itself,\n\
|
||||
and we would appreciate a bug report! You're likely to see \n\
|
||||
a number of compiler warnings after this message which cargo\n\
|
||||
attempted to fix but failed. If you could open an issue at\n\
|
||||
|
@ -1149,8 +1149,7 @@ fn ignored_git_revision() {
|
||||
foo.cargo("build -v")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[WARNING] key `branch` is ignored for dependency (bar). \
|
||||
"[WARNING] key `branch` is ignored for dependency (bar). \
|
||||
This will be considered an error in future versions",
|
||||
)
|
||||
.run();
|
||||
|
@ -4249,20 +4249,17 @@ fn targets_selected_default() {
|
||||
p.cargo("build -v")
|
||||
// Binaries.
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
--emit=[..]link[..]",
|
||||
)
|
||||
// Benchmarks.
|
||||
.with_stderr_does_not_contain(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C opt-level=3 --test [..]",
|
||||
)
|
||||
// Unit tests.
|
||||
.with_stderr_does_not_contain(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C debuginfo=2 --test [..]",
|
||||
)
|
||||
.run();
|
||||
@ -4274,14 +4271,12 @@ fn targets_selected_all() {
|
||||
p.cargo("build -v --all-targets")
|
||||
// Binaries.
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
--emit=[..]link[..]",
|
||||
)
|
||||
// Unit tests.
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C debuginfo=2 --test [..]",
|
||||
)
|
||||
.run();
|
||||
@ -4293,14 +4288,12 @@ fn all_targets_no_lib() {
|
||||
p.cargo("build -v --all-targets")
|
||||
// Binaries.
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
--emit=[..]link[..]",
|
||||
)
|
||||
// Unit tests.
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C debuginfo=2 --test [..]",
|
||||
)
|
||||
.run();
|
||||
@ -4337,8 +4330,7 @@ fn no_linkable_target() {
|
||||
.build();
|
||||
p.cargo("build")
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[WARNING] The package `the_lib` provides no linkable [..] \
|
||||
"[WARNING] The package `the_lib` provides no linkable [..] \
|
||||
while compiling `foo`. [..] in `the_lib`'s Cargo.toml. [..]",
|
||||
)
|
||||
.run();
|
||||
|
@ -29,11 +29,9 @@ fn http_auth_offered() {
|
||||
let mut conn = BufStream::new(server.accept().unwrap().0);
|
||||
let req = headers(&mut conn);
|
||||
conn.write_all(
|
||||
b"\
|
||||
HTTP/1.1 401 Unauthorized\r\n\
|
||||
WWW-Authenticate: Basic realm=\"wheee\"\r\n
|
||||
\r\n\
|
||||
",
|
||||
b"HTTP/1.1 401 Unauthorized\r\n\
|
||||
WWW-Authenticate: Basic realm=\"wheee\"\r\n\
|
||||
\r\n",
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@ -51,11 +49,9 @@ fn http_auth_offered() {
|
||||
let mut conn = BufStream::new(server.accept().unwrap().0);
|
||||
let req = headers(&mut conn);
|
||||
conn.write_all(
|
||||
b"\
|
||||
HTTP/1.1 401 Unauthorized\r\n\
|
||||
WWW-Authenticate: Basic realm=\"wheee\"\r\n
|
||||
\r\n\
|
||||
",
|
||||
b"HTTP/1.1 401 Unauthorized\r\n\
|
||||
WWW-Authenticate: Basic realm=\"wheee\"\r\n\
|
||||
\r\n",
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@ -117,10 +113,9 @@ fn http_auth_offered() {
|
||||
.file("src/main.rs", "")
|
||||
.file(
|
||||
".cargo/config",
|
||||
"\
|
||||
[net]
|
||||
retry = 0
|
||||
",
|
||||
"[net]
|
||||
retry = 0
|
||||
",
|
||||
)
|
||||
.build();
|
||||
|
||||
@ -183,10 +178,9 @@ fn https_something_happens() {
|
||||
.file("src/main.rs", "")
|
||||
.file(
|
||||
".cargo/config",
|
||||
"\
|
||||
[net]
|
||||
retry = 0
|
||||
",
|
||||
"[net]
|
||||
retry = 0
|
||||
",
|
||||
)
|
||||
.build();
|
||||
|
||||
|
@ -189,8 +189,7 @@ fn custom_build_script_wrong_rustc_flags() {
|
||||
p.cargo("build")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ([CWD])`: \
|
||||
"[ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ([CWD])`: \
|
||||
`-aaa -bbb`",
|
||||
)
|
||||
.run();
|
||||
|
@ -793,8 +793,7 @@ fn build_script_needed_for_host_and_target() {
|
||||
host = host
|
||||
))
|
||||
.with_stderr_contains(&format!(
|
||||
"\
|
||||
[RUNNING] `rustc [..] src/main.rs [..] --target {target} [..] \
|
||||
"[RUNNING] `rustc [..] src/main.rs [..] --target {target} [..] \
|
||||
-L /path/to/{target}`",
|
||||
target = target
|
||||
))
|
||||
|
@ -1400,35 +1400,23 @@ fn combining_features_and_package() {
|
||||
p.cargo("build -Z package-features --all --features main")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[ERROR] cannot specify features for more than one package",
|
||||
)
|
||||
.with_stderr_contains("[ERROR] cannot specify features for more than one package")
|
||||
.run();
|
||||
|
||||
p.cargo("build -Z package-features --package dep --features main")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[ERROR] cannot specify features for packages outside of workspace",
|
||||
)
|
||||
.with_stderr_contains("[ERROR] cannot specify features for packages outside of workspace")
|
||||
.run();
|
||||
p.cargo("build -Z package-features --package dep --all-features")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[ERROR] cannot specify features for packages outside of workspace",
|
||||
)
|
||||
.with_stderr_contains("[ERROR] cannot specify features for packages outside of workspace")
|
||||
.run();
|
||||
p.cargo("build -Z package-features --package dep --no-default-features")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[ERROR] cannot specify features for packages outside of workspace",
|
||||
)
|
||||
.with_stderr_contains("[ERROR] cannot specify features for packages outside of workspace")
|
||||
.run();
|
||||
|
||||
p.cargo("build -Z package-features --all --all-features")
|
||||
|
@ -141,8 +141,7 @@ fn broken_fixes_backed_out() {
|
||||
.env("__CARGO_FIX_YOLO", "1")
|
||||
.env("RUSTC", p.root().join("foo/target/debug/foo"))
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
warning: failed to automatically apply fixes suggested by rustc \
|
||||
"warning: failed to automatically apply fixes suggested by rustc \
|
||||
to crate `bar`\n\
|
||||
\n\
|
||||
after fixes were automatically applied the compiler reported \
|
||||
@ -517,8 +516,7 @@ fn preserve_line_endings() {
|
||||
let p = project()
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
"\
|
||||
fn add(a: &u32) -> u32 { a + 1 }\r\n\
|
||||
"fn add(a: &u32) -> u32 { a + 1 }\r\n\
|
||||
pub fn foo() -> u32 { let mut x = 3; add(&x) }\r\n\
|
||||
",
|
||||
)
|
||||
@ -535,9 +533,8 @@ fn fix_deny_warnings() {
|
||||
let p = project()
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
"\
|
||||
#![deny(warnings)]
|
||||
pub fn foo() { let mut x = 3; drop(x); }
|
||||
"#![deny(warnings)]
|
||||
pub fn foo() { let mut x = 3; drop(x); }
|
||||
",
|
||||
)
|
||||
.build();
|
||||
@ -703,8 +700,7 @@ fn warns_if_no_vcs_detected() {
|
||||
p.cargo("fix")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
error: no VCS found for this package and `cargo fix` can potentially perform \
|
||||
"error: no VCS found for this package and `cargo fix` can potentially perform \
|
||||
destructive changes; if you'd like to suppress this error pass `--allow-no-vcs`\
|
||||
",
|
||||
)
|
||||
|
@ -204,10 +204,9 @@ fn install_location_precedence() {
|
||||
.unwrap()
|
||||
.write_all(
|
||||
format!(
|
||||
"\
|
||||
[install]
|
||||
root = '{}'
|
||||
",
|
||||
"[install]
|
||||
root = '{}'
|
||||
",
|
||||
t3.display()
|
||||
)
|
||||
.as_bytes(),
|
||||
@ -822,8 +821,7 @@ fn uninstall_cwd() {
|
||||
p.cargo("uninstall")
|
||||
.with_stdout("")
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
[REMOVING] {home}/bin/foo[EXE]",
|
||||
"[REMOVING] {home}/bin/foo[EXE]",
|
||||
home = cargo_home().display()
|
||||
))
|
||||
.run();
|
||||
@ -836,10 +834,7 @@ fn uninstall_cwd_not_installed() {
|
||||
p.cargo("uninstall")
|
||||
.with_status(101)
|
||||
.with_stdout("")
|
||||
.with_stderr(
|
||||
"\
|
||||
error: package `foo v0.0.1 ([CWD])` is not installed",
|
||||
)
|
||||
.with_stderr("error: package `foo v0.0.1 ([CWD])` is not installed")
|
||||
.run();
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,7 @@ fn reserved_name() {
|
||||
cargo_process("new test")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] The name `test` cannot be used as a crate name\n\
|
||||
"[ERROR] The name `test` cannot be used as a crate name\n\
|
||||
use --name to override crate name",
|
||||
)
|
||||
.run();
|
||||
@ -149,8 +148,7 @@ fn reserved_binary_name() {
|
||||
cargo_process("new --bin incremental")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] The name `incremental` cannot be used as a crate name\n\
|
||||
"[ERROR] The name `incremental` cannot be used as a crate name\n\
|
||||
use --name to override crate name",
|
||||
)
|
||||
.run();
|
||||
@ -161,8 +159,7 @@ fn keyword_name() {
|
||||
cargo_process("new pub")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] The name `pub` cannot be used as a crate name\n\
|
||||
"[ERROR] The name `pub` cannot be used as a crate name\n\
|
||||
use --name to override crate name",
|
||||
)
|
||||
.run();
|
||||
|
@ -295,8 +295,7 @@ fn no_rebuild_dependency() {
|
||||
// Don't compile bar, but do recompile foo.
|
||||
p.cargo("build")
|
||||
.with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])\n\
|
||||
"[COMPILING] foo v0.5.0 ([..])\n\
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) \
|
||||
in [..]\n",
|
||||
)
|
||||
|
@ -797,8 +797,7 @@ fn run_from_executable_folder() {
|
||||
p.cargo("run")
|
||||
.cwd(cwd)
|
||||
.with_stderr(
|
||||
"\
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n\
|
||||
"[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n\
|
||||
[RUNNING] `./foo[EXE]`",
|
||||
)
|
||||
.with_stdout("hello")
|
||||
|
@ -232,20 +232,17 @@ fn targets_selected_default() {
|
||||
p.cargo("rustc -v")
|
||||
// bin
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
--emit=[..]link[..]",
|
||||
)
|
||||
// bench
|
||||
.with_stderr_does_not_contain(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C opt-level=3 --test [..]",
|
||||
)
|
||||
// unit test
|
||||
.with_stderr_does_not_contain(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C debuginfo=2 --test [..]",
|
||||
)
|
||||
.run();
|
||||
@ -257,14 +254,12 @@ fn targets_selected_all() {
|
||||
p.cargo("rustc -v --all-targets")
|
||||
// bin
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
|
||||
--emit=[..]link[..]",
|
||||
)
|
||||
// unit test
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
|
||||
-C debuginfo=2 --test [..]",
|
||||
)
|
||||
.run();
|
||||
|
@ -224,7 +224,7 @@ fn custom_runner_cfg_precedence() {
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([CWD])
|
||||
[COMPILING] foo v0.0.1 ([CWD])
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
[RUNNING] `nonexistent-runner -r target/debug/foo[EXE] --param`
|
||||
",
|
||||
|
Loading…
x
Reference in New Issue
Block a user