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

Dead code in Subcommand::from_arg_matches #2588

Closed
2 tasks done
epage opened this issue Jul 14, 2021 · 0 comments · Fixed by #2590
Closed
2 tasks done

Dead code in Subcommand::from_arg_matches #2588

epage opened this issue Jul 14, 2021 · 0 comments · Fixed by #2590
Labels
A-derive Area: #[derive]` macro API C-bug Category: Updating dependencies

Comments

@epage
Copy link
Member

epage commented Jul 14, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

rustc 1.53.0 (53cb7b09b 2021-06-17)

Clap Version

3.0.0-beta.2

Minimal reproducible code

#[derive(Clap)]
enum Parent {
  #[flatten]
  Child(Child)
}

#[derive(Clap)]
enum Child{
  One,
  Two,
}

Steps to reproduce the bug with the above code

Run cargo expand

Actual Behaviour

impl FromArgMatches for Parent will have a case for a command name child when no child command exists

Expected Behaviour

The child case doesn't exist

Additional Context

No response

Debug Output

No response

@epage epage added the C-bug Category: Updating dependencies label Jul 14, 2021
@pksunkara pksunkara added the A-derive Area: #[derive]` macro API label Jul 14, 2021
epage added a commit to epage/clap that referenced this issue Jul 14, 2021
When debugging clap-rs#2586, I noticed we were developing match cases for
variant names that were flattened.  At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.

Depends on clap-rs#2587

Fixes clap-rs#2588
@pksunkara pksunkara modified the milestone: 3.0 Jul 14, 2021
epage added a commit to epage/clap that referenced this issue Jul 14, 2021
When debugging clap-rs#2586, I noticed we were developing match cases for
variant names that were flattened.  At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.

Depends on clap-rs#2587

Fixes clap-rs#2588
epage added a commit to epage/clap that referenced this issue Jul 14, 2021
When debugging clap-rs#2586, I noticed we were developing match cases for
variant names that were flattened.  At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.

Depends on clap-rs#2587

Fixes clap-rs#2588
epage added a commit to epage/clap that referenced this issue Jul 15, 2021
When debugging clap-rs#2586, I noticed we were developing match cases for
variant names that were flattened.  At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.

Depends on clap-rs#2587

Fixes clap-rs#2588
epage added a commit to epage/clap that referenced this issue Jul 16, 2021
When debugging clap-rs#2586, I noticed we were developing match cases for
variant names that were flattened.  At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.

Depends on clap-rs#2587

Fixes clap-rs#2588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-derive Area: #[derive]` macro API C-bug Category: Updating dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants