From 3da2b3c67bb56c50e1f8353894b47185da58e4f2 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 11 Apr 2023 19:42:28 -0700 Subject: [PATCH] Mark -C as unstable --- CHANGELOG.md | 4 +-- src/bin/cargo/cli.rs | 19 +++++++++++- src/doc/man/generated_txt/cargo-add.txt | 5 ++++ src/doc/man/generated_txt/cargo-bench.txt | 5 ++++ src/doc/man/generated_txt/cargo-build.txt | 5 ++++ src/doc/man/generated_txt/cargo-check.txt | 5 ++++ src/doc/man/generated_txt/cargo-clean.txt | 5 ++++ src/doc/man/generated_txt/cargo-doc.txt | 5 ++++ src/doc/man/generated_txt/cargo-fetch.txt | 5 ++++ src/doc/man/generated_txt/cargo-fix.txt | 5 ++++ .../generated_txt/cargo-generate-lockfile.txt | 5 ++++ src/doc/man/generated_txt/cargo-init.txt | 5 ++++ src/doc/man/generated_txt/cargo-install.txt | 5 ++++ .../generated_txt/cargo-locate-project.txt | 5 ++++ src/doc/man/generated_txt/cargo-login.txt | 5 ++++ src/doc/man/generated_txt/cargo-metadata.txt | 5 ++++ src/doc/man/generated_txt/cargo-new.txt | 5 ++++ src/doc/man/generated_txt/cargo-owner.txt | 5 ++++ src/doc/man/generated_txt/cargo-package.txt | 5 ++++ src/doc/man/generated_txt/cargo-pkgid.txt | 5 ++++ src/doc/man/generated_txt/cargo-publish.txt | 5 ++++ src/doc/man/generated_txt/cargo-remove.txt | 5 ++++ src/doc/man/generated_txt/cargo-run.txt | 5 ++++ src/doc/man/generated_txt/cargo-rustc.txt | 5 ++++ src/doc/man/generated_txt/cargo-rustdoc.txt | 5 ++++ src/doc/man/generated_txt/cargo-search.txt | 5 ++++ src/doc/man/generated_txt/cargo-test.txt | 5 ++++ src/doc/man/generated_txt/cargo-tree.txt | 5 ++++ src/doc/man/generated_txt/cargo-uninstall.txt | 5 ++++ src/doc/man/generated_txt/cargo-update.txt | 5 ++++ src/doc/man/generated_txt/cargo-vendor.txt | 5 ++++ .../generated_txt/cargo-verify-project.txt | 5 ++++ src/doc/man/generated_txt/cargo-yank.txt | 5 ++++ src/doc/man/generated_txt/cargo.txt | 5 ++++ .../man/includes/section-options-common.md | 5 ++++ src/doc/src/commands/cargo-add.md | 6 +++- src/doc/src/commands/cargo-bench.md | 6 +++- src/doc/src/commands/cargo-build.md | 6 +++- src/doc/src/commands/cargo-check.md | 6 +++- src/doc/src/commands/cargo-clean.md | 6 +++- src/doc/src/commands/cargo-doc.md | 6 +++- src/doc/src/commands/cargo-fetch.md | 6 +++- src/doc/src/commands/cargo-fix.md | 6 +++- .../src/commands/cargo-generate-lockfile.md | 6 +++- src/doc/src/commands/cargo-init.md | 6 +++- src/doc/src/commands/cargo-install.md | 6 +++- src/doc/src/commands/cargo-locate-project.md | 6 +++- src/doc/src/commands/cargo-login.md | 6 +++- src/doc/src/commands/cargo-metadata.md | 6 +++- src/doc/src/commands/cargo-new.md | 6 +++- src/doc/src/commands/cargo-owner.md | 6 +++- src/doc/src/commands/cargo-package.md | 6 +++- src/doc/src/commands/cargo-pkgid.md | 6 +++- src/doc/src/commands/cargo-publish.md | 6 +++- src/doc/src/commands/cargo-remove.md | 6 +++- src/doc/src/commands/cargo-run.md | 6 +++- src/doc/src/commands/cargo-rustc.md | 6 +++- src/doc/src/commands/cargo-rustdoc.md | 6 +++- src/doc/src/commands/cargo-search.md | 6 +++- src/doc/src/commands/cargo-test.md | 6 +++- src/doc/src/commands/cargo-tree.md | 6 +++- src/doc/src/commands/cargo-uninstall.md | 6 +++- src/doc/src/commands/cargo-update.md | 6 +++- src/doc/src/commands/cargo-vendor.md | 6 +++- src/doc/src/commands/cargo-verify-project.md | 6 +++- src/doc/src/commands/cargo-yank.md | 6 +++- src/doc/src/commands/cargo.md | 6 +++- src/etc/man/cargo-add.1 | 5 ++++ src/etc/man/cargo-bench.1 | 5 ++++ src/etc/man/cargo-build.1 | 5 ++++ src/etc/man/cargo-check.1 | 5 ++++ src/etc/man/cargo-clean.1 | 5 ++++ src/etc/man/cargo-doc.1 | 5 ++++ src/etc/man/cargo-fetch.1 | 5 ++++ src/etc/man/cargo-fix.1 | 5 ++++ src/etc/man/cargo-generate-lockfile.1 | 5 ++++ src/etc/man/cargo-init.1 | 5 ++++ src/etc/man/cargo-install.1 | 5 ++++ src/etc/man/cargo-locate-project.1 | 5 ++++ src/etc/man/cargo-login.1 | 5 ++++ src/etc/man/cargo-metadata.1 | 5 ++++ src/etc/man/cargo-new.1 | 5 ++++ src/etc/man/cargo-owner.1 | 5 ++++ src/etc/man/cargo-package.1 | 5 ++++ src/etc/man/cargo-pkgid.1 | 5 ++++ src/etc/man/cargo-publish.1 | 5 ++++ src/etc/man/cargo-remove.1 | 5 ++++ src/etc/man/cargo-run.1 | 5 ++++ src/etc/man/cargo-rustc.1 | 5 ++++ src/etc/man/cargo-rustdoc.1 | 5 ++++ src/etc/man/cargo-search.1 | 5 ++++ src/etc/man/cargo-test.1 | 5 ++++ src/etc/man/cargo-tree.1 | 5 ++++ src/etc/man/cargo-uninstall.1 | 5 ++++ src/etc/man/cargo-update.1 | 5 ++++ src/etc/man/cargo-vendor.1 | 5 ++++ src/etc/man/cargo-verify-project.1 | 5 ++++ src/etc/man/cargo-yank.1 | 5 ++++ src/etc/man/cargo.1 | 5 ++++ tests/testsuite/build.rs | 30 +++++++++++++++++-- 100 files changed, 533 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a73f4f2d61..a3d488d9249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,8 +67,6 @@ ### Added -- Added `-C` flag for changing current dir before build starts. - [#10952](https://github.com/rust-lang/cargo/pull/10952) - Cargo now suggests `cargo fix` or `cargo clippy --fix` when compilation warnings are auto-fixable. [#11558](https://github.com/rust-lang/cargo/pull/11558) @@ -130,6 +128,8 @@ - Emit an error message for transitive artifact dependencies with targets the package doesn't directly interact with. [#11643](https://github.com/rust-lang/cargo/pull/11643) +- Added `-C` flag for changing current dir before build starts. + [#10952](https://github.com/rust-lang/cargo/pull/10952) ### Documentation diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index f84ec53ad68..17120a656ce 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -31,6 +31,23 @@ pub fn main(config: &mut LazyConfig) -> CliResult { // This must be completed before config is initialized assert_eq!(config.is_init(), false); if let Some(new_cwd) = args.get_one::("directory") { + // This is a temporary hack. This cannot access `Config`, so this is a bit messy. + // This does not properly parse `-Z` flags that appear after the subcommand. + // The error message is not as helpful as the standard one. + let nightly_features_allowed = matches!(&*features::channel(), "nightly" | "dev"); + if !nightly_features_allowed + || (nightly_features_allowed + && !args + .get_many("unstable-features") + .map(|mut z| z.any(|value: &String| value == "unstable-options")) + .unwrap_or(false)) + { + return Err(anyhow::format_err!( + "the `-C` flag is unstable, \ + pass `-Z unstable-options` on the nightly channel to enable it" + ) + .into()); + } std::env::set_current_dir(&new_cwd).context("could not change to requested directory")?; } @@ -479,7 +496,7 @@ See 'cargo help ' for more information on a specific command.\n", ) .arg( Arg::new("directory") - .help("Change to DIRECTORY before doing anything") + .help("Change to DIRECTORY before doing anything (nightly-only)") .short('C') .value_name("DIRECTORY") .value_hint(clap::ValueHint::DirPath) diff --git a/src/doc/man/generated_txt/cargo-add.txt b/src/doc/man/generated_txt/cargo-add.txt index 69d844f4169..ac332a44e72 100644 --- a/src/doc/man/generated_txt/cargo-add.txt +++ b/src/doc/man/generated_txt/cargo-add.txt @@ -195,6 +195,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index bd2054fb150..1ca72d577af 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -380,6 +380,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-build.txt b/src/doc/man/generated_txt/cargo-build.txt index 57b6c7f855c..ff8bdb5ba72 100644 --- a/src/doc/man/generated_txt/cargo-build.txt +++ b/src/doc/man/generated_txt/cargo-build.txt @@ -322,6 +322,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-check.txt b/src/doc/man/generated_txt/cargo-check.txt index dfae7ded527..bf8cb48f319 100644 --- a/src/doc/man/generated_txt/cargo-check.txt +++ b/src/doc/man/generated_txt/cargo-check.txt @@ -307,6 +307,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-clean.txt b/src/doc/man/generated_txt/cargo-clean.txt index 17a630609a7..33cebb719db 100644 --- a/src/doc/man/generated_txt/cargo-clean.txt +++ b/src/doc/man/generated_txt/cargo-clean.txt @@ -136,6 +136,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index c03dedd133b..82503282685 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -278,6 +278,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-fetch.txt b/src/doc/man/generated_txt/cargo-fetch.txt index cf6e9962bb1..cbd3169c313 100644 --- a/src/doc/man/generated_txt/cargo-fetch.txt +++ b/src/doc/man/generated_txt/cargo-fetch.txt @@ -121,6 +121,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-fix.txt b/src/doc/man/generated_txt/cargo-fix.txt index 8d01e521944..87d72ad381a 100644 --- a/src/doc/man/generated_txt/cargo-fix.txt +++ b/src/doc/man/generated_txt/cargo-fix.txt @@ -380,6 +380,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-generate-lockfile.txt b/src/doc/man/generated_txt/cargo-generate-lockfile.txt index 263b3b0d4d2..17f2a37ab7c 100644 --- a/src/doc/man/generated_txt/cargo-generate-lockfile.txt +++ b/src/doc/man/generated_txt/cargo-generate-lockfile.txt @@ -96,6 +96,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-init.txt b/src/doc/man/generated_txt/cargo-init.txt index 35430437d1a..678024881bb 100644 --- a/src/doc/man/generated_txt/cargo-init.txt +++ b/src/doc/man/generated_txt/cargo-init.txt @@ -104,6 +104,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt index 68dab27aa76..a29cdcd46ec 100644 --- a/src/doc/man/generated_txt/cargo-install.txt +++ b/src/doc/man/generated_txt/cargo-install.txt @@ -359,6 +359,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-locate-project.txt b/src/doc/man/generated_txt/cargo-locate-project.txt index 612fbc943df..68a563bfbec 100644 --- a/src/doc/man/generated_txt/cargo-locate-project.txt +++ b/src/doc/man/generated_txt/cargo-locate-project.txt @@ -87,6 +87,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-login.txt b/src/doc/man/generated_txt/cargo-login.txt index a3309b1116a..681e3b8574c 100644 --- a/src/doc/man/generated_txt/cargo-login.txt +++ b/src/doc/man/generated_txt/cargo-login.txt @@ -79,6 +79,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-metadata.txt b/src/doc/man/generated_txt/cargo-metadata.txt index 8dec32b1fab..be8bed7c66f 100644 --- a/src/doc/man/generated_txt/cargo-metadata.txt +++ b/src/doc/man/generated_txt/cargo-metadata.txt @@ -409,6 +409,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-new.txt b/src/doc/man/generated_txt/cargo-new.txt index b74103ffacf..5d2c61b48b3 100644 --- a/src/doc/man/generated_txt/cargo-new.txt +++ b/src/doc/man/generated_txt/cargo-new.txt @@ -99,6 +99,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-owner.txt b/src/doc/man/generated_txt/cargo-owner.txt index 391d87224ab..a77975da008 100644 --- a/src/doc/man/generated_txt/cargo-owner.txt +++ b/src/doc/man/generated_txt/cargo-owner.txt @@ -106,6 +106,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-package.txt b/src/doc/man/generated_txt/cargo-package.txt index d3c5a6b8814..960e0248e96 100644 --- a/src/doc/man/generated_txt/cargo-package.txt +++ b/src/doc/man/generated_txt/cargo-package.txt @@ -248,6 +248,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-pkgid.txt b/src/doc/man/generated_txt/cargo-pkgid.txt index bb618ab1a7f..e2df3fd9893 100644 --- a/src/doc/man/generated_txt/cargo-pkgid.txt +++ b/src/doc/man/generated_txt/cargo-pkgid.txt @@ -126,6 +126,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-publish.txt b/src/doc/man/generated_txt/cargo-publish.txt index 7942f332f5b..d35172ad739 100644 --- a/src/doc/man/generated_txt/cargo-publish.txt +++ b/src/doc/man/generated_txt/cargo-publish.txt @@ -214,6 +214,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-remove.txt b/src/doc/man/generated_txt/cargo-remove.txt index a01f2a213c7..53451c28952 100644 --- a/src/doc/man/generated_txt/cargo-remove.txt +++ b/src/doc/man/generated_txt/cargo-remove.txt @@ -115,6 +115,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-run.txt b/src/doc/man/generated_txt/cargo-run.txt index 855532609ee..f6782be1169 100644 --- a/src/doc/man/generated_txt/cargo-run.txt +++ b/src/doc/man/generated_txt/cargo-run.txt @@ -226,6 +226,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-rustc.txt b/src/doc/man/generated_txt/cargo-rustc.txt index eb7e167d376..cc4241f93a0 100644 --- a/src/doc/man/generated_txt/cargo-rustc.txt +++ b/src/doc/man/generated_txt/cargo-rustc.txt @@ -324,6 +324,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-rustdoc.txt b/src/doc/man/generated_txt/cargo-rustdoc.txt index 3f37652a716..6a32a6b6e6a 100644 --- a/src/doc/man/generated_txt/cargo-rustdoc.txt +++ b/src/doc/man/generated_txt/cargo-rustdoc.txt @@ -294,6 +294,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-search.txt b/src/doc/man/generated_txt/cargo-search.txt index e293240d6ba..74bbda9f706 100644 --- a/src/doc/man/generated_txt/cargo-search.txt +++ b/src/doc/man/generated_txt/cargo-search.txt @@ -76,6 +76,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-test.txt b/src/doc/man/generated_txt/cargo-test.txt index c70842d4a89..3f4ed607235 100644 --- a/src/doc/man/generated_txt/cargo-test.txt +++ b/src/doc/man/generated_txt/cargo-test.txt @@ -398,6 +398,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-tree.txt b/src/doc/man/generated_txt/cargo-tree.txt index 3ce00e89c40..5b81f0aa1f3 100644 --- a/src/doc/man/generated_txt/cargo-tree.txt +++ b/src/doc/man/generated_txt/cargo-tree.txt @@ -307,6 +307,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-uninstall.txt b/src/doc/man/generated_txt/cargo-uninstall.txt index 3d30775b2bb..53b21cde892 100644 --- a/src/doc/man/generated_txt/cargo-uninstall.txt +++ b/src/doc/man/generated_txt/cargo-uninstall.txt @@ -88,6 +88,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-update.txt b/src/doc/man/generated_txt/cargo-update.txt index 0c2497d31fe..fb662c3890f 100644 --- a/src/doc/man/generated_txt/cargo-update.txt +++ b/src/doc/man/generated_txt/cargo-update.txt @@ -126,6 +126,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-vendor.txt b/src/doc/man/generated_txt/cargo-vendor.txt index 97dfcb02efc..c325b753423 100644 --- a/src/doc/man/generated_txt/cargo-vendor.txt +++ b/src/doc/man/generated_txt/cargo-vendor.txt @@ -122,6 +122,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-verify-project.txt b/src/doc/man/generated_txt/cargo-verify-project.txt index 8449a154274..e0e7a4d2b28 100644 --- a/src/doc/man/generated_txt/cargo-verify-project.txt +++ b/src/doc/man/generated_txt/cargo-verify-project.txt @@ -99,6 +99,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo-yank.txt b/src/doc/man/generated_txt/cargo-yank.txt index 057a569bf14..376d7373c6b 100644 --- a/src/doc/man/generated_txt/cargo-yank.txt +++ b/src/doc/man/generated_txt/cargo-yank.txt @@ -103,6 +103,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/generated_txt/cargo.txt b/src/doc/man/generated_txt/cargo.txt index 297da56caa7..37b1e5139d9 100644 --- a/src/doc/man/generated_txt/cargo.txt +++ b/src/doc/man/generated_txt/cargo.txt @@ -205,6 +205,11 @@ OPTIONS option must appear before the command name, for example cargo -C path/to/my-project build. + This option is only available on the nightly channel + and + requires the -Z unstable-options flag to enable (see #10098 + ). + -h, --help Prints help information. diff --git a/src/doc/man/includes/section-options-common.md b/src/doc/man/includes/section-options-common.md index efae1219a75..5a41169d6f0 100644 --- a/src/doc/man/includes/section-options-common.md +++ b/src/doc/man/includes/section-options-common.md @@ -21,6 +21,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (`Cargo.toml`), as well as the directories searched for discovering `.cargo/config.toml`, for example. This option must appear before the command name, for example `cargo -C path/to/my-project build`. + +This option is only available on the [nightly +channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) and +requires the `-Z unstable-options` flag to enable (see +[#10098](https://github.com/rust-lang/cargo/issues/10098)). {{/option}} {{#option "`-h`" "`--help`"}} diff --git a/src/doc/src/commands/cargo-add.md b/src/doc/src/commands/cargo-add.md index 8cdaa3157f4..89c1cc6f1ea 100644 --- a/src/doc/src/commands/cargo-add.md +++ b/src/doc/src/commands/cargo-add.md @@ -226,7 +226,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index 3006eca8166..e7e9b36fb8f 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -439,7 +439,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md index a68efeca6e0..6e3cf157acb 100644 --- a/src/doc/src/commands/cargo-build.md +++ b/src/doc/src/commands/cargo-build.md @@ -375,7 +375,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md index aa14776ce53..2070293acca 100644 --- a/src/doc/src/commands/cargo-check.md +++ b/src/doc/src/commands/cargo-check.md @@ -356,7 +356,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-clean.md b/src/doc/src/commands/cargo-clean.md index 4f2b49fd0c8..bdbcb86d4a9 100644 --- a/src/doc/src/commands/cargo-clean.md +++ b/src/doc/src/commands/cargo-clean.md @@ -160,7 +160,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 9f1110c483e..e0e5c8ed219 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -330,7 +330,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-fetch.md b/src/doc/src/commands/cargo-fetch.md index e8693b583f3..e6a46079551 100644 --- a/src/doc/src/commands/cargo-fetch.md +++ b/src/doc/src/commands/cargo-fetch.md @@ -134,7 +134,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md index aa4387635a1..1b9ec6a8526 100644 --- a/src/doc/src/commands/cargo-fix.md +++ b/src/doc/src/commands/cargo-fix.md @@ -436,7 +436,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-generate-lockfile.md b/src/doc/src/commands/cargo-generate-lockfile.md index 47e5250fdd8..eb8d2e30e13 100644 --- a/src/doc/src/commands/cargo-generate-lockfile.md +++ b/src/doc/src/commands/cargo-generate-lockfile.md @@ -108,7 +108,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-init.md b/src/doc/src/commands/cargo-init.md index 06e45a0f018..c0cf34b517c 100644 --- a/src/doc/src/commands/cargo-init.md +++ b/src/doc/src/commands/cargo-init.md @@ -121,7 +121,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md index e8ec32b1729..99697c156c3 100644 --- a/src/doc/src/commands/cargo-install.md +++ b/src/doc/src/commands/cargo-install.md @@ -403,7 +403,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-locate-project.md b/src/doc/src/commands/cargo-locate-project.md index 16e05da323b..00491b398c6 100644 --- a/src/doc/src/commands/cargo-locate-project.md +++ b/src/doc/src/commands/cargo-locate-project.md @@ -103,7 +103,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-login.md b/src/doc/src/commands/cargo-login.md index 0fc2e3bf61d..ab13aaa7c97 100644 --- a/src/doc/src/commands/cargo-login.md +++ b/src/doc/src/commands/cargo-login.md @@ -89,7 +89,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-metadata.md b/src/doc/src/commands/cargo-metadata.md index 7dbb371f812..ebde0ea101c 100644 --- a/src/doc/src/commands/cargo-metadata.md +++ b/src/doc/src/commands/cargo-metadata.md @@ -438,7 +438,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-new.md b/src/doc/src/commands/cargo-new.md index f1608e37813..144b6f2ebd4 100644 --- a/src/doc/src/commands/cargo-new.md +++ b/src/doc/src/commands/cargo-new.md @@ -116,7 +116,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-owner.md b/src/doc/src/commands/cargo-owner.md index fe3c3c0ff1b..caf16f4b29e 100644 --- a/src/doc/src/commands/cargo-owner.md +++ b/src/doc/src/commands/cargo-owner.md @@ -127,7 +127,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-package.md b/src/doc/src/commands/cargo-package.md index 8c5a51668eb..776b150cf84 100644 --- a/src/doc/src/commands/cargo-package.md +++ b/src/doc/src/commands/cargo-package.md @@ -293,7 +293,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-pkgid.md b/src/doc/src/commands/cargo-pkgid.md index 88e8ee292cf..d7e507506b0 100644 --- a/src/doc/src/commands/cargo-pkgid.md +++ b/src/doc/src/commands/cargo-pkgid.md @@ -137,7 +137,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-publish.md b/src/doc/src/commands/cargo-publish.md index 2e4e2e2bcf2..1f4fbebb8bc 100644 --- a/src/doc/src/commands/cargo-publish.md +++ b/src/doc/src/commands/cargo-publish.md @@ -259,7 +259,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-remove.md b/src/doc/src/commands/cargo-remove.md index ce491864c78..571c4107503 100644 --- a/src/doc/src/commands/cargo-remove.md +++ b/src/doc/src/commands/cargo-remove.md @@ -145,7 +145,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-run.md b/src/doc/src/commands/cargo-run.md index 2393c519ab4..f6f5ec2a343 100644 --- a/src/doc/src/commands/cargo-run.md +++ b/src/doc/src/commands/cargo-run.md @@ -272,7 +272,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md index 28980fcbdae..946298af914 100644 --- a/src/doc/src/commands/cargo-rustc.md +++ b/src/doc/src/commands/cargo-rustc.md @@ -369,7 +369,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index aada321c5a0..8467da2a32c 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -349,7 +349,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-search.md b/src/doc/src/commands/cargo-search.md index 7a211c8d713..72e2accf3ae 100644 --- a/src/doc/src/commands/cargo-search.md +++ b/src/doc/src/commands/cargo-search.md @@ -93,7 +93,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index 5cfa66a6626..2967d7381e9 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -462,7 +462,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-tree.md b/src/doc/src/commands/cargo-tree.md index d89e0fe583c..9a9aa9f0c2f 100644 --- a/src/doc/src/commands/cargo-tree.md +++ b/src/doc/src/commands/cargo-tree.md @@ -340,7 +340,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-uninstall.md b/src/doc/src/commands/cargo-uninstall.md index 0de68fc5f38..e9c73b0cd56 100644 --- a/src/doc/src/commands/cargo-uninstall.md +++ b/src/doc/src/commands/cargo-uninstall.md @@ -103,7 +103,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-update.md b/src/doc/src/commands/cargo-update.md index 2b5f350f150..3cfd6928222 100644 --- a/src/doc/src/commands/cargo-update.md +++ b/src/doc/src/commands/cargo-update.md @@ -148,7 +148,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-vendor.md b/src/doc/src/commands/cargo-vendor.md index d480dcc555c..cf47fc25658 100644 --- a/src/doc/src/commands/cargo-vendor.md +++ b/src/doc/src/commands/cargo-vendor.md @@ -144,7 +144,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-verify-project.md b/src/doc/src/commands/cargo-verify-project.md index 77ac2594aa9..2a1d5d950be 100644 --- a/src/doc/src/commands/cargo-verify-project.md +++ b/src/doc/src/commands/cargo-verify-project.md @@ -114,7 +114,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo-yank.md b/src/doc/src/commands/cargo-yank.md index 79f238785f3..18565d2dcb9 100644 --- a/src/doc/src/commands/cargo-yank.md +++ b/src/doc/src/commands/cargo-yank.md @@ -123,7 +123,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/doc/src/commands/cargo.md b/src/doc/src/commands/cargo.md index dc604fcbdff..54ffc46e12b 100644 --- a/src/doc/src/commands/cargo.md +++ b/src/doc/src/commands/cargo.md @@ -231,7 +231,11 @@ See the command-line o
Changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must -appear before the command name, for example cargo -C path/to/my-project build.
+appear before the command name, for example cargo -C path/to/my-project build.

+

This option is only available on the nightly +channel and +requires the -Z unstable-options flag to enable (see +#10098).

-h
diff --git a/src/etc/man/cargo-add.1 b/src/etc/man/cargo-add.1 index 069e0e40966..086a561fd65 100644 --- a/src/etc/man/cargo-add.1 +++ b/src/etc/man/cargo-add.1 @@ -245,6 +245,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index 0b76afdf73b..b95902c4ecf 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -463,6 +463,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1 index 2cb24e8f316..80ae4ac9092 100644 --- a/src/etc/man/cargo-build.1 +++ b/src/etc/man/cargo-build.1 @@ -387,6 +387,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1 index f45f195e7b9..cf7a66d89d7 100644 --- a/src/etc/man/cargo-check.1 +++ b/src/etc/man/cargo-check.1 @@ -368,6 +368,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-clean.1 b/src/etc/man/cargo-clean.1 index 4703e7846b6..3cb321f05f0 100644 --- a/src/etc/man/cargo-clean.1 +++ b/src/etc/man/cargo-clean.1 @@ -161,6 +161,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index ec2ed937ac6..63ce2a05036 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -335,6 +335,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-fetch.1 b/src/etc/man/cargo-fetch.1 index 2c2ec125456..3779b9c2862 100644 --- a/src/etc/man/cargo-fetch.1 +++ b/src/etc/man/cargo-fetch.1 @@ -135,6 +135,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1 index 80de236eb89..51b1e3fd64e 100644 --- a/src/etc/man/cargo-fix.1 +++ b/src/etc/man/cargo-fix.1 @@ -463,6 +463,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-generate-lockfile.1 b/src/etc/man/cargo-generate-lockfile.1 index 55ec4e0308b..075f6324c75 100644 --- a/src/etc/man/cargo-generate-lockfile.1 +++ b/src/etc/man/cargo-generate-lockfile.1 @@ -114,6 +114,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-init.1 b/src/etc/man/cargo-init.1 index 9a268896a86..56d1aca9f66 100644 --- a/src/etc/man/cargo-init.1 +++ b/src/etc/man/cargo-init.1 @@ -127,6 +127,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1 index 370e3e06550..d0e5c518167 100644 --- a/src/etc/man/cargo-install.1 +++ b/src/etc/man/cargo-install.1 @@ -451,6 +451,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-locate-project.1 b/src/etc/man/cargo-locate-project.1 index a9f18beb0e7..2fbbe183b9b 100644 --- a/src/etc/man/cargo-locate-project.1 +++ b/src/etc/man/cargo-locate-project.1 @@ -106,6 +106,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-login.1 b/src/etc/man/cargo-login.1 index f7f395f0e46..79a9634db01 100644 --- a/src/etc/man/cargo-login.1 +++ b/src/etc/man/cargo-login.1 @@ -91,6 +91,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-metadata.1 b/src/etc/man/cargo-metadata.1 index 34b0ac0a795..8549290cde5 100644 --- a/src/etc/man/cargo-metadata.1 +++ b/src/etc/man/cargo-metadata.1 @@ -439,6 +439,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-new.1 b/src/etc/man/cargo-new.1 index ea26e8bbd21..62e0eb157ec 100644 --- a/src/etc/man/cargo-new.1 +++ b/src/etc/man/cargo-new.1 @@ -122,6 +122,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-owner.1 b/src/etc/man/cargo-owner.1 index 4514c16389e..82cac16aae3 100644 --- a/src/etc/man/cargo-owner.1 +++ b/src/etc/man/cargo-owner.1 @@ -133,6 +133,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-package.1 b/src/etc/man/cargo-package.1 index 41fdc5ad543..9f4847d7d12 100644 --- a/src/etc/man/cargo-package.1 +++ b/src/etc/man/cargo-package.1 @@ -307,6 +307,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-pkgid.1 b/src/etc/man/cargo-pkgid.1 index 7698094bfc7..9ec1b8cb768 100644 --- a/src/etc/man/cargo-pkgid.1 +++ b/src/etc/man/cargo-pkgid.1 @@ -169,6 +169,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-publish.1 b/src/etc/man/cargo-publish.1 index 1a10ac1cae5..a54a7bcda60 100644 --- a/src/etc/man/cargo-publish.1 +++ b/src/etc/man/cargo-publish.1 @@ -257,6 +257,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-remove.1 b/src/etc/man/cargo-remove.1 index 7757f921c85..40498161711 100644 --- a/src/etc/man/cargo-remove.1 +++ b/src/etc/man/cargo-remove.1 @@ -140,6 +140,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-run.1 b/src/etc/man/cargo-run.1 index ee82ee094c8..7a85298ccd4 100644 --- a/src/etc/man/cargo-run.1 +++ b/src/etc/man/cargo-run.1 @@ -272,6 +272,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1 index 910ba0a9c60..6e901d9ecad 100644 --- a/src/etc/man/cargo-rustc.1 +++ b/src/etc/man/cargo-rustc.1 @@ -386,6 +386,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index cc0c9d78be4..0c9a0e74a7d 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -354,6 +354,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-search.1 b/src/etc/man/cargo-search.1 index 8d078eebea9..245d4e65dd9 100644 --- a/src/etc/man/cargo-search.1 +++ b/src/etc/man/cargo-search.1 @@ -94,6 +94,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index 6d2c3eecc02..85260b067b0 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -482,6 +482,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-tree.1 b/src/etc/man/cargo-tree.1 index 8f4d6e2dc3e..2abad97320b 100644 --- a/src/etc/man/cargo-tree.1 +++ b/src/etc/man/cargo-tree.1 @@ -382,6 +382,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-uninstall.1 b/src/etc/man/cargo-uninstall.1 index 14a8450a1f0..304d5788a14 100644 --- a/src/etc/man/cargo-uninstall.1 +++ b/src/etc/man/cargo-uninstall.1 @@ -117,6 +117,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-update.1 b/src/etc/man/cargo-update.1 index 1d7c94e15d4..6f697b3ab19 100644 --- a/src/etc/man/cargo-update.1 +++ b/src/etc/man/cargo-update.1 @@ -154,6 +154,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-vendor.1 b/src/etc/man/cargo-vendor.1 index d3210187480..cb46f67cde4 100644 --- a/src/etc/man/cargo-vendor.1 +++ b/src/etc/man/cargo-vendor.1 @@ -145,6 +145,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-verify-project.1 b/src/etc/man/cargo-verify-project.1 index 573f9e852f1..d067dd66555 100644 --- a/src/etc/man/cargo-verify-project.1 +++ b/src/etc/man/cargo-verify-project.1 @@ -124,6 +124,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo-yank.1 b/src/etc/man/cargo-yank.1 index ee3cc1161ed..423c7bc9915 100644 --- a/src/etc/man/cargo-yank.1 +++ b/src/etc/man/cargo-yank.1 @@ -125,6 +125,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/src/etc/man/cargo.1 b/src/etc/man/cargo.1 index f01aab25a89..374f25e4773 100644 --- a/src/etc/man/cargo.1 +++ b/src/etc/man/cargo.1 @@ -257,6 +257,11 @@ Changes the current working directory before executing any specified operations. things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&. +.sp +This option is only available on the \fInightly +channel\fR and +requires the \fB\-Z unstable\-options\fR flag to enable (see +\fI#10098\fR ). .RE .sp \fB\-h\fR, diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 677212c6b07..8a1b6ca86c1 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -159,6 +159,30 @@ fn cargo_compile_manifest_path() { assert!(p.bin("foo").is_file()); } +#[cargo_test] +fn chdir_gated() { + let p = project() + .file("Cargo.toml", &basic_bin_manifest("foo")) + .build(); + p.cargo("-C foo build") + .cwd(p.root().parent().unwrap()) + .with_stderr( + "error: the `-C` flag is unstable, \ + pass `-Z unstable-options` on the nightly channel to enable it", + ) + .with_status(101) + .run(); + // No masquerade should also fail. + p.cargo("-C foo -Z unstable-options build") + .cwd(p.root().parent().unwrap()) + .with_stderr( + "error: the `-C` flag is unstable, \ + pass `-Z unstable-options` on the nightly channel to enable it", + ) + .with_status(101) + .run(); +} + #[cargo_test] fn cargo_compile_directory_not_cwd() { let p = project() @@ -167,7 +191,8 @@ fn cargo_compile_directory_not_cwd() { .file(".cargo/config.toml", &"") .build(); - p.cargo("-C foo build") + p.cargo("-Zunstable-options -C foo build") + .masquerade_as_nightly_cargo(&["chdir"]) .cwd(p.root().parent().unwrap()) .run(); assert!(p.bin("foo").is_file()); @@ -181,7 +206,8 @@ fn cargo_compile_directory_not_cwd_with_invalid_config() { .file(".cargo/config.toml", &"!") .build(); - p.cargo("-C foo build") + p.cargo("-Zunstable-options -C foo build") + .masquerade_as_nightly_cargo(&["chdir"]) .cwd(p.root().parent().unwrap()) .with_status(101) .with_stderr_contains(