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

Using clap derive triggers a ton of deprecation warnings since 3.2 #3823

Closed
2 tasks done
Ten0 opened this issue Jun 13, 2022 · 4 comments
Closed
2 tasks done

Using clap derive triggers a ton of deprecation warnings since 3.2 #3823

Ten0 opened this issue Jun 13, 2022 · 4 comments
Labels
C-bug Category: Updating dependencies S-duplicate Status: Closed as Duplicate

Comments

@Ten0
Copy link

Ten0 commented Jun 13, 2022

Please complete the following tasks

Rust Version

Latest stable (1.61)

Clap Version

3.2.1

Minimal reproducible code

use clap::Parser;

#[derive(Parser)]
pub struct Args {
    /// Input delimiter
    #[structopt(short, long, default_value = ",")]
    pub delimiter: String,
    #[structopt(short, long)]
    pub flexible: bool,
    /// Abc
    #[structopt(short, long = "abece")]
    pub abc: Vec<String>,
}

Steps to reproduce the bug with the above code

cargo update
cargo build

Actual Behaviour

warning: use of deprecated unit variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
 --> src/lib.rs:5:5
  |
5 |     /// Input delimiter
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default

warning: use of deprecated unit variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> src/lib.rs:10:5
   |
10 |     /// Abc
   |     ^^^^^^^

warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
 --> src/lib.rs:9:19
  |
9 |     pub flexible: bool,
  |                   ^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
 --> src/lib.rs:5:5
  |
5 |     /// Input delimiter
  |     ^^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::multiple_occurrences`: Replaced with `Arg::action` (Issue #3772)
  --> src/lib.rs:12:14
   |
12 |     pub abc: Vec<String>,
   |              ^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> src/lib.rs:10:5
   |
10 |     /// Abc
   |     ^^^^^^^

Expected Behaviour

no warnings

Additional Context

No response

Debug Output

No response

@Ten0 Ten0 added the C-bug Category: Updating dependencies label Jun 13, 2022
@Ten0 Ten0 changed the title Using clap derive triggers a ton of deprecation warnings Using clap derive triggers a ton of deprecation warnings since 3.2 Jun 13, 2022
@epage
Copy link
Member

epage commented Jun 13, 2022

This is a duplicate of #3820

@epage epage closed this as completed Jun 13, 2022
@epage epage added the S-duplicate Status: Closed as Duplicate label Jun 13, 2022
@Ten0
Copy link
Author

Ten0 commented Jun 13, 2022

This is a duplicate of #3820

That doesn't seem related in any way to the #3820 PR which fixes a panic

@Ten0
Copy link
Author

Ten0 commented Jun 13, 2022

In addition there's no other open issue since 3.2 was released and introduced this issue a few hours ago, so I don't see how this can be a duplicate of anything.

@epage
Copy link
Member

epage commented Jun 13, 2022

Was off by 2, it is #3822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies S-duplicate Status: Closed as Duplicate
Projects
None yet
Development

No branches or pull requests

2 participants