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

Update to clap 3.1.0 #10397

Closed
wants to merge 1 commit into from
Closed

Update to clap 3.1.0 #10397

wants to merge 1 commit into from

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Feb 17, 2022

This PR fixes the deprecation errors I saw in the CI of #10394.

Clap 3.1.0 introduced some new deprecations: https://github.com/clap-rs/clap/releases/tag/v3.1.0

warning: use of deprecated struct `clap::App`: Replaced with `Command`
  --> src/cargo/util/command_prelude.rs:25:22
   |
25 | pub type App = clap::App<'static>;
   |                      ^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated variant `clap::AppSettings::DontCollapseArgsInUsage`: Replaced with `Command::dont_collapse_args_in_usage` and `Command::is_dont_collapse_args_in_usage_set`
   --> src/cargo/util/command_prelude.rs:284:75
    |
284 |     App::new(name).setting(AppSettings::DeriveDisplayOrder | AppSettings::DontCollapseArgsInUsage)
    |                                                                           ^^^^^^^^^^^^^^^^^^^^^^^

warning: `cargo` (lib) generated 2 warnings
warning: use of deprecated variant `clap::AppSettings::NoBinaryName`: Replaced with `Command::no_binary_name`
   --> src/bin/cargo/cli.rs:290:43
    |
290 |                     .setting(AppSettings::NoBinaryName)
    |                                           ^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated variant `clap::AppSettings::AllowExternalSubcommands`: Replaced with `Command::allow_external_subcommands` and `Command::is_allow_external_subcommands_set`
   --> src/bin/cargo/cli.rs:411:32
    |
411 |                 | AppSettings::AllowExternalSubcommands
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::DisableColoredHelp`: Replaced with `Command::disable_colored_help` and `Command::is_disable_colored_help_set`
   --> src/bin/cargo/cli.rs:416:38
    |
416 |         .global_setting(AppSettings::DisableColoredHelp)
    |                                      ^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::TrailingVarArg`: Replaced with `Command::trailing_var_arg` and `Command::is_trailing_var_arg_set`
 --> src/bin/cargo/commands/bench.rs:6:31
  |
6 |         .setting(AppSettings::TrailingVarArg)
  |                               ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::SubcommandRequiredElseHelp`: Replaced with `Command::subcommand_required` combined with `Command::arg_required_else_help`
 --> src/bin/cargo/commands/config.rs:8:37
  |
8 |         .setting(clap::AppSettings::SubcommandRequiredElseHelp)
  |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::Hidden`: Replaced with `Command::hide` and `Command::is_hide_set`
 --> src/bin/cargo/commands/git_checkout.rs:8:31
  |
8 |         .setting(AppSettings::Hidden)
  |                               ^^^^^^

warning: use of deprecated variant `clap::AppSettings::SubcommandRequiredElseHelp`: Replaced with `Command::subcommand_required` combined with `Command::arg_required_else_help`
 --> src/bin/cargo/commands/report.rs:9:37
  |
9 |         .setting(clap::AppSettings::SubcommandRequiredElseHelp)
  |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::TrailingVarArg`: Replaced with `Command::trailing_var_arg` and `Command::is_trailing_var_arg_set`
  --> src/bin/cargo/commands/run.rs:11:31
   |
11 |         .setting(AppSettings::TrailingVarArg)
   |                               ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::TrailingVarArg`: Replaced with `Command::trailing_var_arg` and `Command::is_trailing_var_arg_set`
  --> src/bin/cargo/commands/rustc.rs:10:31
   |
10 |         .setting(AppSettings::TrailingVarArg)
   |                               ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::TrailingVarArg`: Replaced with `Command::trailing_var_arg` and `Command::is_trailing_var_arg_set`
 --> src/bin/cargo/commands/rustdoc.rs:7:31
  |
7 |         .setting(AppSettings::TrailingVarArg)
  |                               ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::AppSettings::TrailingVarArg`: Replaced with `Command::trailing_var_arg` and `Command::is_trailing_var_arg_set`
 --> src/bin/cargo/commands/test.rs:9:31
  |
9 |         .setting(AppSettings::TrailingVarArg)
  |                               ^^^^^^^^^^^^^^

warning: use of deprecated field `clap::Error::kind`: Replaced with `Error::kind()`
  --> src/bin/cargo/cli.rs:36:16
   |
36 |             if e.kind == clap::ErrorKind::UnrecognizedSubcommand {
   |                ^^^^^^

warning: use of deprecated field `clap::Error::info`: Replaced with `Error::context()`
  --> src/bin/cargo/cli.rs:38:27
   |
38 |                 let cmd = e.info[0].clone();
   |                           ^^^^^^

warning: `cargo` (bin "cargo") generated 13 warnings

@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 17, 2022
@Eh2406
Copy link
Contributor

Eh2406 commented Feb 17, 2022

cc #10396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants