Skip to content

Commit 632ace6

Browse files
committed
document the -Zallow-yanked-deps unstable CLI flag
1 parent 226eefd commit 632ace6

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

src/bin/cargo/cli.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ pub fn main(config: &mut Config) -> CliResult {
2828
"
2929
Available unstable (nightly-only) flags:
3030
31-
-Z avoid-dev-deps -- Avoid installing dev-dependencies if possible
32-
-Z minimal-versions -- Install minimal dependency versions instead of maximum
33-
-Z no-index-update -- Do not update the registry, avoids a network request for benchmarking
34-
-Z offline -- Offline mode that does not perform network requests
35-
-Z unstable-options -- Allow the usage of unstable options such as --registry
36-
-Z config-profile -- Read profiles from .cargo/config files
37-
-Z compile-progress -- Display a progress bar while compiling
31+
-Z avoid-dev-deps -- Avoid installing dev-dependencies if possible
32+
-Z minimal-versions -- Install minimal dependency versions instead of maximum
33+
-Z no-index-update -- Do not update the registry, avoids a network request for benchmarking
34+
-Z offline -- Offline mode that does not perform network requests
35+
-Z unstable-options -- Allow the usage of unstable options such as --registry
36+
-Z config-profile -- Read profiles from .cargo/config files
37+
-Z compile-progress -- Display a progress bar while compiling
38+
-Z allow-yanked-deps -- Allow depending on yanked crates
3839
3940
Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
4041
);

src/doc/src/reference/unstable.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ directory. Example:
198198
cargo +nightly build --out-dir=out -Z unstable-options
199199
```
200200

201+
## allow-yanked-deps
202+
* Original Issue: [#4425](https://github.com/rust-lang/cargo/issues/4225)
203+
204+
This feature allows your project to depend on yanked crates.
205+
206+
The flag can be useful if you need to build an old project that relies on a
207+
yanked dependency, and you can't update it. The flag should not be used on new
208+
or maintained projects: remember that yanked crates are not meant to be used.
209+
210+
```
211+
cargo +nightly build -Z allow-yanked-deps
212+
```
201213

202214
### Edition
203215
* Tracking Issue: [rust-lang/rust#44581](https://github.com/rust-lang/rust/issues/44581)

tests/testsuite/cargo_command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,6 @@ fn explain() {
315315
fn z_flags_help() {
316316
cargo_process("-Z help")
317317
.with_stdout_contains(
318-
" -Z unstable-options -- Allow the usage of unstable options such as --registry",
318+
" -Z unstable-options -- Allow the usage of unstable options such as --registry",
319319
).run();
320320
}

0 commit comments

Comments
 (0)