Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean up for deprecated and removed commands #14739

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/bin/cargo/commands/git_checkout.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! Removed.

use crate::command_prelude::*;

const REMOVED: &str = "The `git-checkout` command has been removed.";

pub fn cli() -> Command {
subcommand("git-checkout")
.about("This command has been removed")
.about("REMOVED: This command has been removed")
.hide(true)
.override_help(REMOVED)
}
Expand Down
7 changes: 5 additions & 2 deletions src/bin/cargo/commands/read_manifest.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
//! Deprecated.

use crate::command_prelude::*;

pub fn cli() -> Command {
subcommand("read-manifest")
.hide(true)
epage marked this conversation as resolved.
Show resolved Hide resolved
.about(color_print::cstr!(
"\
Print a JSON representation of a Cargo.toml manifest.
DEPRECATED: Print a JSON representation of a Cargo.toml manifest.

Deprecated, use `<cyan,bold>cargo metadata --no-deps</>` instead.\
Use `<cyan,bold>cargo metadata --no-deps</>` instead.\
"
))
.arg_silent_suggestion()
Expand Down
7 changes: 5 additions & 2 deletions src/bin/cargo/commands/verify_project.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
//! Deprecated.

use crate::command_prelude::*;

use std::collections::HashMap;
use std::process;

pub fn cli() -> Command {
subcommand("verify-project")
.hide(true)
.about(
"\
Check correctness of crate manifest.
DEPRECATED: Check correctness of crate manifest.

Deprecated, see https://github.com/rust-lang/cargo/issues/14679.",
See https://github.com/rust-lang/cargo/issues/14679.",
)
.arg_silent_suggestion()
.arg_manifest_path()
Expand Down
3 changes: 3 additions & 0 deletions src/doc/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ search.use-boolean-and = true

[output.html.redirect]
"/guide/build-cache.html" = "../reference/build-cache.html"
"/commands/cargo-git-checkout.html" = "./deprecated-and-removed.html"
"/commands/cargo-read-manifest.html" = "./deprecated-and-removed.html"
"/commands/cargo-verify-project.html" = "./deprecated-and-removed.html"
1 change: 1 addition & 0 deletions src/doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
* [cargo package](commands/cargo-package.md)
* [cargo publish](commands/cargo-publish.md)
* [cargo yank](commands/cargo-yank.md)
* [Deprecated and Removed](commands/deprecated-and-removed.md)

* [FAQ](faq.md)
* [Appendix: Glossary](appendix/glossary.md)
Expand Down
10 changes: 10 additions & 0 deletions src/doc/src/commands/deprecated-and-removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Deprecated and Removed Commands

These commands have been deprecated or removed in early Rust releases.
Deprecated commands receive only critical bug fixes,
and may be removed in future versions.
Removed commands are no longer functional and are unsupported.

* `read-manifest` --- deprecated since Rust 1.13
* `git-checkout` --- removed since Rust 1.44
* `verify-project` --- deprecated since Rust 1.84
1 change: 1 addition & 0 deletions src/doc/src/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* [Manifest Commands](manifest-commands.md)
* [Package Commands](package-commands.md)
* [Publishing Commands](publishing-commands.md)
* [Deprecated and Removed](deprecated-and-removed.md)
8 changes: 0 additions & 8 deletions src/etc/_cargo
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ _cargo() {
'--dry-run[perform all checks without uploading]'
;;

read-manifest)
_arguments -s -S $common $manifest
;;

remove | rm)
_arguments -s -A "^--" $common $manifest \
"--dev[remove as a dev dependency]" \
Expand Down Expand Up @@ -356,10 +352,6 @@ _cargo() {
'*:package:_cargo_package_names'
;;

verify-project)
_arguments -s -S $common $manifest
;;

version)
_arguments -s -S $common
;;
Expand Down
2 changes: 0 additions & 2 deletions src/etc/cargo.bashcomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ _cargo()
local opt__package="$opt_common $opt_mani $opt_feat $opt_lock $opt_parallel --allow-dirty -l --list --no-verify --no-metadata --index --registry --target --target-dir"
local opt__pkgid="$opt_common $opt_mani $opt_lock $opt_pkg"
local opt__publish="$opt_common $opt_mani $opt_feat $opt_lock $opt_parallel --allow-dirty --dry-run --token --no-verify --index --registry --target --target-dir"
local opt__read_manifest="$opt_help $opt_quiet $opt_verbose $opt_mani $opt_color $opt_lock --no-deps"
local opt__remove="$opt_common $opt_pkg $opt_lock $opt_mani --dry-run --dev --build --target"
local opt__rm="$opt__remove"
local opt__report="$opt_help $opt_verbose $opt_color future-incompat future-incompatibilities"
Expand All @@ -90,7 +89,6 @@ _cargo()
local opt__uninstall="$opt_common $opt_lock $opt_pkg --bin --root"
local opt__update="$opt_common $opt_mani $opt_lock $opt_pkg --aggressive --recursive --precise --dry-run"
local opt__vendor="$opt_common $opt_mani $opt_lock $opt_sync --no-delete --respect-source-config --versioned-dirs"
local opt__verify_project="$opt_common $opt_mani $opt_lock"
local opt__version="$opt_common $opt_lock"
local opt__yank="$opt_common $opt_lock --version --undo --index --token --registry"
local opt__libtest="--help --include-ignored --ignored --test --bench --list --logfile --nocapture --test-threads --skip -q --quiet --exact --color --format"
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn list_commands_with_descriptions() {
...
r alias: run
...
read-manifest Print a JSON representation of a Cargo.toml manifest.
read-manifest DEPRECATED: Print a JSON representation of a Cargo.toml manifest.
...
t alias: test
...
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_read_manifest/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_verify_project/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.