diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs index 5a6b669604d..746e01d01e2 100644 --- a/src/cargo/core/compiler/mod.rs +++ b/src/cargo/core/compiler/mod.rs @@ -815,6 +815,9 @@ fn prepare_rustc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResult if build_runner.bcx.gctx.cli_unstable().checksum_freshness { base.arg("-Z").arg("checksum-hash-algorithm=blake3"); } + if gctx.shell().verbosity() == Verbosity::Verbose && unit.is_local() { + base.arg("--verbose"); + } if is_primary { base.env("CARGO_PRIMARY_PACKAGE", "1"); diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 276ca3b6c5a..229b7aa99e9 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -1571,7 +1571,7 @@ fn cargo_default_env_metadata_env_var() { .with_stderr_data(format!( "\ ... -[RUNNING] `rustc --crate-name foo [..]--extern bar=[ROOT]/foo/target/debug/deps/{dll_prefix}bar{dll_suffix}` +[RUNNING] `rustc --crate-name foo [..]--extern bar=[ROOT]/foo/target/debug/deps/{dll_prefix}bar{dll_suffix}[..]` ... ")) .run(); @@ -1584,7 +1584,7 @@ fn cargo_default_env_metadata_env_var() { .with_stderr_data(format!( "\ ... -[RUNNING] `rustc --crate-name foo [..]--extern bar=[ROOT]/foo/target/debug/deps/{dll_prefix}bar-[..]{dll_suffix}` +[RUNNING] `rustc --crate-name foo [..]--extern bar=[ROOT]/foo/target/debug/deps/{dll_prefix}bar-[..]{dll_suffix}[..]` ... ")) .run(); @@ -5890,7 +5890,7 @@ fn build_lib_only() { p.cargo("build --lib -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs index d07853a2f89..662b330e3ed 100644 --- a/tests/testsuite/build_script.rs +++ b/tests/testsuite/build_script.rs @@ -1122,9 +1122,9 @@ fn custom_build_script_rustc_flags() { [COMPILING] foo v0.5.0 ([ROOT]/foo/foo) [RUNNING] `rustc --crate-name build_script_build --edition=2015 foo/build.rs [..]` [RUNNING] `[ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` -[RUNNING] `rustc --crate-name foo --edition=2015 foo/src/lib.rs [..]-L dependency=[ROOT]/foo/target/debug/deps -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2 -l nonexistinglib` +[RUNNING] `rustc --crate-name foo --edition=2015 foo/src/lib.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --verbose -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2 -l nonexistinglib` [COMPILING] bar v0.5.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name bar --edition=2015 src/main.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2` +[RUNNING] `rustc --crate-name bar --edition=2015 src/main.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib --verbose -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); @@ -1181,9 +1181,9 @@ fn custom_build_script_rustc_flags_no_space() { [COMPILING] foo v0.5.0 ([ROOT]/foo/foo) [RUNNING] `rustc --crate-name build_script_build --edition=2015 foo/build.rs [..]` [RUNNING] `[ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` -[RUNNING] `rustc --crate-name foo --edition=2015 foo/src/lib.rs [..]-L dependency=[ROOT]/foo/target/debug/deps -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2 -l nonexistinglib` +[RUNNING] `rustc --crate-name foo --edition=2015 foo/src/lib.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --verbose -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2 -l nonexistinglib` [COMPILING] bar v0.5.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name bar --edition=2015 src/main.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2` +[RUNNING] `rustc --crate-name bar --edition=2015 src/main.rs [..]-L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib --verbose -L [ROOT]/foo/dummy-path1 -L [ROOT]/foo/dummy-path2` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); @@ -2374,7 +2374,7 @@ fn build_deps_simple() { [COMPILING] a v0.5.0 ([ROOT]/foo/a) [RUNNING] `rustc --crate-name a [..]` [COMPILING] foo v0.5.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name build_script_build [..] build.rs [..] --extern a=[ROOT]/foo/target/debug/deps/liba-[HASH].rlib` +[RUNNING] `rustc --crate-name build_script_build [..] build.rs [..] --extern a=[ROOT]/foo/target/debug/deps/liba-[HASH].rlib[..]` [RUNNING] `[ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` [RUNNING] `rustc --crate-name foo [..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s @@ -2487,13 +2487,13 @@ fn build_cmd_with_a_build_cmd() { [COMPILING] b v0.5.0 ([ROOT]/foo/b) [RUNNING] `rustc --crate-name b [..]` [COMPILING] a v0.5.0 ([ROOT]/foo/a) -[RUNNING] `rustc --crate-name build_script_build [..] a/build.rs [..] --extern b=[ROOT]/foo/target/debug/deps/libb-[HASH].rlib` +[RUNNING] `rustc --crate-name build_script_build [..] a/build.rs [..] --extern b=[ROOT]/foo/target/debug/deps/libb-[HASH].rlib[..]` [RUNNING] `[ROOT]/foo/target/debug/build/a-[HASH]/build-script-build` -[RUNNING] `rustc --crate-name a [..]a/src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name a [..]a/src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [COMPILING] foo v0.5.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name build_script_build --edition=2015 build.rs [..]--crate-type bin --emit=[..]link[..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/build/foo-[HASH] -L dependency=[ROOT]/foo/target/debug/deps --extern a=[ROOT]/foo/target/debug/deps/liba-[HASH].rlib` +[RUNNING] `rustc --crate-name build_script_build --edition=2015 build.rs [..]--crate-type bin --emit=[..]link[..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/build/foo-[HASH] -L dependency=[ROOT]/foo/target/debug/deps --extern a=[ROOT]/foo/target/debug/deps/liba-[HASH].rlib[..]` [RUNNING] `[ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` -[RUNNING] `rustc --crate-name foo [..]src/lib.rs [..]--crate-type lib --emit=[..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name foo [..]src/lib.rs [..]--crate-type lib --emit=[..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index ad8e76c6f01..227a516438d 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -494,7 +494,7 @@ fn linker() { please set bin.path in Cargo.toml [WARNING] `foo` (manifest) generated 1 warning [COMPILING] foo v0.5.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo --edition=2015 src/foo.rs [..]--crate-type bin --emit=[..]link[..]-C debuginfo=2 [..] -C metadata=[..] --out-dir [ROOT]/foo/target/[ALT_TARGET]/debug/deps --target [ALT_TARGET] -C linker=my-linker-tool -L dependency=[ROOT]/foo/target/[ALT_TARGET]/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name foo --edition=2015 src/foo.rs [..]--crate-type bin --emit=[..]link[..]-C debuginfo=2 [..] -C metadata=[..] --out-dir [ROOT]/foo/target/[ALT_TARGET]/debug/deps --target [ALT_TARGET] -C linker=my-linker-tool -L dependency=[ROOT]/foo/target/[ALT_TARGET]/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [ERROR] linker `my-linker-tool` not found ... "#]]) diff --git a/tests/testsuite/pgo.rs b/tests/testsuite/pgo.rs index 14444c0f314..596d6cbf6d2 100644 --- a/tests/testsuite/pgo.rs +++ b/tests/testsuite/pgo.rs @@ -104,7 +104,7 @@ fn pgo_works() { ) .with_stderr_data(str![[r#" [COMPILING] foo v0.0.0 ([ROOT]/foo) -[RUNNING] `rustc [..]-Cprofile-use=[ROOT]/foo/target/merged.profdata -Cllvm-args=-pgo-warn-missing-function` +[RUNNING] `rustc [..]-Cprofile-use=[ROOT]/foo/target/merged.profdata -Cllvm-args=-pgo-warn-missing-function[..]` [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s "#]]) diff --git a/tests/testsuite/profiles.rs b/tests/testsuite/profiles.rs index 9f93c1e8929..8ede705121f 100644 --- a/tests/testsuite/profiles.rs +++ b/tests/testsuite/profiles.rs @@ -29,7 +29,7 @@ fn profile_overrides() { .build(); p.cargo("build -v").with_stderr_data(str![[r#" [COMPILING] test v0.0.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -C opt-level=1[..] -C debug-assertions=on[..] -C metadata=[..] -C rpath --out-dir [ROOT]/foo/target/debug/deps [..] -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -C opt-level=1[..] -C debug-assertions=on[..] -C metadata=[..] -C rpath --out-dir [ROOT]/foo/target/debug/deps [..] -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [optimized] target(s) in [ELAPSED]s "#]]).run(); @@ -56,7 +56,7 @@ fn opt_level_override_0() { .build(); p.cargo("build -v").with_stderr_data(str![[r#" [COMPILING] test v0.0.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..] -C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..] -C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); @@ -82,7 +82,7 @@ fn debug_override_1() { .build(); p.cargo("build -v").with_stderr_data(str![[r#" [COMPILING] test v0.0.0 ([ROOT]/foo) -[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=1 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=1 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); @@ -120,7 +120,7 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) { -C debug-assertions=on[..] \ -C metadata=[..] \ --out-dir [..] \ - -L dependency=[ROOT]/foo/target/debug/deps` + -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [..]+ debuginfo] target(s) in [ELAPSED]s ", level = rustc_level @@ -197,7 +197,7 @@ fn top_level_overrides_deps() { -C debuginfo=2 [..]\ -C metadata=[..] \ --out-dir [ROOT]/foo/target/release/deps \ - -L dependency=[ROOT]/foo/target/release/deps` + -L dependency=[ROOT]/foo/target/release/deps[..]` [COMPILING] test v0.0.0 ([ROOT]/foo) [RUNNING] `rustc --crate-name test --edition=2015 src/lib.rs [..]--crate-type lib \ --emit=[..]link \ @@ -208,7 +208,7 @@ fn top_level_overrides_deps() { -L dependency=[ROOT]/foo/target/release/deps \ --extern foo=[ROOT]/foo/target/release/deps/\ {prefix}foo[..]{suffix} \ - --extern foo=[ROOT]/foo/target/release/deps/libfoo.rlib` + --extern foo=[ROOT]/foo/target/release/deps/libfoo.rlib[..]` [FINISHED] `release` profile [optimized + debuginfo] target(s) in [ELAPSED]s ", prefix = env::consts::DLL_PREFIX, diff --git a/tests/testsuite/run.rs b/tests/testsuite/run.rs index 61fcd429298..521c6ae7cac 100644 --- a/tests/testsuite/run.rs +++ b/tests/testsuite/run.rs @@ -1105,9 +1105,9 @@ fn example_with_release_flag() { .with_stderr_data(str![[r#" [LOCKING] 1 package to latest compatible version [COMPILING] bar v0.5.0 ([ROOT]/foo/bar) -[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/bar.rs [..]--crate-type lib --emit=[..]link -C opt-level=3[..] -C metadata=[..] --out-dir [ROOT]/foo/target/release/deps -C strip=debuginfo -L dependency=[ROOT]/foo/target/release/deps` +[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/bar.rs [..]--crate-type lib --emit=[..]link -C opt-level=3[..] -C metadata=[..] --out-dir [ROOT]/foo/target/release/deps -C strip=debuginfo -L dependency=[ROOT]/foo/target/release/deps[..]` [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name a --edition=2015 examples/a.rs [..]--crate-type bin --emit=[..]link -C opt-level=3[..] -C metadata=[..] --out-dir [ROOT]/foo/target/release/examples -C strip=debuginfo -L dependency=[ROOT]/foo/target/release/deps --extern bar=[ROOT]/foo/target/release/deps/libbar-[HASH].rlib` +[RUNNING] `rustc --crate-name a --edition=2015 examples/a.rs [..]--crate-type bin --emit=[..]link -C opt-level=3[..] -C metadata=[..] --out-dir [ROOT]/foo/target/release/examples -C strip=debuginfo -L dependency=[ROOT]/foo/target/release/deps --extern bar=[ROOT]/foo/target/release/deps/libbar-[HASH].rlib[..]` [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s [RUNNING] `target/release/examples/a[EXE]` @@ -1122,9 +1122,9 @@ fast2 p.cargo("run -v --example a") .with_stderr_data(str![[r#" [COMPILING] bar v0.5.0 ([ROOT]/foo/bar) -[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/bar.rs [..]--crate-type lib --emit=[..]link [..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/bar.rs [..]--crate-type lib --emit=[..]link [..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name a --edition=2015 examples/a.rs [..]--crate-type bin --emit=[..]link [..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/examples -L dependency=[ROOT]/foo/target/debug/deps --extern bar=[ROOT]/foo/target/debug/deps/libbar-[HASH].rlib` +[RUNNING] `rustc --crate-name a --edition=2015 examples/a.rs [..]--crate-type bin --emit=[..]link [..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/examples -L dependency=[ROOT]/foo/target/debug/deps --extern bar=[ROOT]/foo/target/debug/deps/libbar-[HASH].rlib[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `target/debug/examples/a[EXE]` diff --git a/tests/testsuite/rustc.rs b/tests/testsuite/rustc.rs index 2c6d5fca99c..8e565faeda7 100644 --- a/tests/testsuite/rustc.rs +++ b/tests/testsuite/rustc.rs @@ -17,7 +17,7 @@ fn build_lib_for_foo() { p.cargo("rustc --lib -v").with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..]-C metadata=[..] [..]--out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..]-C metadata=[..] [..]--out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]).run(); @@ -50,7 +50,7 @@ fn build_main_and_allow_unstable_options() { p.cargo("rustc -v --bin foo -- -C debug-assertions") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps` +[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps[..]` [RUNNING] `rustc --crate-name foo --edition=2015 src/main.rs [..]--crate-type bin --emit=[..]link[..]-C debuginfo=2 [..]-C metadata=[..] --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib[..]-C debug-assertions[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s @@ -870,7 +870,7 @@ fn precedence() { .env("RUSTFLAGS", "--cfg from_rustflags") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.0 ([ROOT]/foo) -[RUNNING] `rustc [..]-C strip=debuginfo [..]--cfg cargo_rustc -C strip=symbols --cfg from_rustflags` +[RUNNING] `rustc [..]-C strip=debuginfo [..]--cfg cargo_rustc -C strip=symbols --cfg from_rustflags[..]` [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s "#]]) @@ -898,3 +898,42 @@ fn build_with_duplicate_crate_types() { "#]]) .run(); } + +#[cargo_test] +fn verbose_flag_forwarded_to_rustc_for_local_only() { + cargo_test_support::registry::Package::new("bar", "1.0.0") + .file("src/lib.rs", "pub fn bar() {}") + .publish(); + + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + edition = "2015" + + [dependencies] + bar = "1.0" + "#, + ) + .file("src/lib.rs", "extern crate bar; pub fn main() {}") + .build(); + + p.cargo("build -v") + .with_stderr_data(str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[DOWNLOADING] crates ... +[DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) +[COMPILING] bar v1.0.0 +[RUNNING] `rustc --crate-name bar [..]` +[COMPILING] foo v0.1.0 ([ROOT]/foo) +[RUNNING] `rustc --crate-name foo [..] --verbose` +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) + .with_stderr_does_not_contain("[RUNNING] `rustc --crate-name bar [..] --verbose`") + .run(); +} diff --git a/tests/testsuite/rustdocflags.rs b/tests/testsuite/rustdocflags.rs index e39bddf60a0..c42b5d49288 100644 --- a/tests/testsuite/rustdocflags.rs +++ b/tests/testsuite/rustdocflags.rs @@ -178,7 +178,7 @@ fn not_affected_by_target_rustflags() { .with_status(101) .with_stderr_data(str![[r#" ... -[RUNNING] `rustc [..] -D missing-docs` +[RUNNING] `rustc [..] -D missing-docs[..]` ... "#]]) .run(); diff --git a/tests/testsuite/rustflags.rs b/tests/testsuite/rustflags.rs index 6d7c68f9e42..324f5adb625 100644 --- a/tests/testsuite/rustflags.rs +++ b/tests/testsuite/rustflags.rs @@ -1166,7 +1166,7 @@ fn cfg_rustflags_normal_source() { p.cargo("build --lib -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg bar` +[RUNNING] `rustc --crate-name foo [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1175,7 +1175,7 @@ fn cfg_rustflags_normal_source() { p.cargo("build --bin=a -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name a [..] --cfg bar` +[RUNNING] `rustc --crate-name a [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1184,7 +1184,7 @@ fn cfg_rustflags_normal_source() { p.cargo("build --example=b -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name b [..] --cfg bar` +[RUNNING] `rustc --crate-name b [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1193,9 +1193,9 @@ fn cfg_rustflags_normal_source() { p.cargo("test --no-run -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [EXECUTABLE] `[ROOT]/foo/target/debug/deps/foo-[HASH][EXE]` [EXECUTABLE] `[ROOT]/foo/target/debug/deps/a-[HASH][EXE]` @@ -1207,9 +1207,9 @@ fn cfg_rustflags_normal_source() { p.cargo("bench --no-run -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` [FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s [EXECUTABLE] `[ROOT]/foo/target/release/deps/foo-[HASH][EXE]` [EXECUTABLE] `[ROOT]/foo/target/release/deps/a-[HASH][EXE]` @@ -1248,7 +1248,7 @@ fn cfg_rustflags_precedence() { p.cargo("build --lib -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg bar` +[RUNNING] `rustc --crate-name foo [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1257,7 +1257,7 @@ fn cfg_rustflags_precedence() { p.cargo("build --bin=a -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name a [..] --cfg bar` +[RUNNING] `rustc --crate-name a [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1266,7 +1266,7 @@ fn cfg_rustflags_precedence() { p.cargo("build --example=b -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name b [..] --cfg bar` +[RUNNING] `rustc --crate-name b [..] --cfg bar[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1275,9 +1275,9 @@ fn cfg_rustflags_precedence() { p.cargo("test --no-run -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [EXECUTABLE] `[ROOT]/foo/target/debug/deps/foo-[HASH][EXE]` [EXECUTABLE] `[ROOT]/foo/target/debug/deps/a-[HASH][EXE]` @@ -1289,9 +1289,9 @@ fn cfg_rustflags_precedence() { p.cargo("bench --no-run -v") .with_stderr_data(str![[r#" [COMPILING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` -[RUNNING] `rustc [..] --cfg bar` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` +[RUNNING] `rustc [..] --cfg bar[..]` [FINISHED] `bench` profile [optimized] target(s) in [ELAPSED]s [EXECUTABLE] `[ROOT]/foo/target/release/deps/foo-[HASH][EXE]` [EXECUTABLE] `[ROOT]/foo/target/release/deps/a-[HASH][EXE]` @@ -1316,7 +1316,7 @@ fn target_rustflags_string_and_array_form1() { p1.cargo("check -v") .with_stderr_data(str![[r#" [CHECKING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg foo` +[RUNNING] `rustc --crate-name foo [..] --cfg foo[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1336,7 +1336,7 @@ fn target_rustflags_string_and_array_form1() { p2.cargo("check -v") .with_stderr_data(str![[r#" [CHECKING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg foo` +[RUNNING] `rustc --crate-name foo [..] --cfg foo[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1362,7 +1362,7 @@ fn target_rustflags_string_and_array_form2() { p1.cargo("check -v") .with_stderr_data(str![[r#" [CHECKING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg foo` +[RUNNING] `rustc --crate-name foo [..] --cfg foo[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]]) @@ -1385,7 +1385,7 @@ fn target_rustflags_string_and_array_form2() { p2.cargo("check -v") .with_stderr_data(str![[r#" [CHECKING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustc --crate-name foo [..] --cfg foo` +[RUNNING] `rustc --crate-name foo [..] --cfg foo[..]` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s "#]])