diff --git a/src/bin/cargo/commands/bench.rs b/src/bin/cargo/commands/bench.rs index f611179e8c9e..3739d880e2c1 100644 --- a/src/bin/cargo/commands/bench.rs +++ b/src/bin/cargo/commands/bench.rs @@ -14,7 +14,7 @@ pub fn cli() -> Command { Arg::new("args") .help("Arguments for the bench binary") .num_args(0..) - .trailing_var_arg(true), + .last(true), ) .arg_targets_all( "Benchmark only this package's library", diff --git a/src/bin/cargo/commands/test.rs b/src/bin/cargo/commands/test.rs index a47b783315a1..607655aaf335 100644 --- a/src/bin/cargo/commands/test.rs +++ b/src/bin/cargo/commands/test.rs @@ -15,7 +15,7 @@ pub fn cli() -> Command { Arg::new("args") .help("Arguments for the test binary") .num_args(0..) - .trailing_var_arg(true), + .last(true), ) .arg( flag( diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs index 10ac9dfc9c50..b6e21775cc51 100644 --- a/tests/testsuite/test.rs +++ b/tests/testsuite/test.rs @@ -760,6 +760,7 @@ fn pass_through_escaped() { [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] test [unoptimized + debuginfo] target(s) in [..] [RUNNING] [..] (target/debug/deps/foo-[..][EXE]) +[DOCTEST] foo ", ) .with_stdout_contains("running 1 test") @@ -771,6 +772,7 @@ fn pass_through_escaped() { "\ [FINISHED] test [unoptimized + debuginfo] target(s) in [..] [RUNNING] [..] (target/debug/deps/foo-[..][EXE]) +[DOCTEST] foo ", ) .with_stdout_contains("running 1 test") @@ -782,6 +784,7 @@ fn pass_through_escaped() { "\ [FINISHED] test [unoptimized + debuginfo] target(s) in [..] [RUNNING] [..] (target/debug/deps/foo-[..][EXE]) +[DOCTEST] foo ", ) .with_stdout_contains("running 2 tests")