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

#![deny(missing_docs)] incompatible with #[clap(flatten)] #2108

Closed
jared-mackey opened this issue Aug 25, 2020 · 1 comment · Fixed by #2110
Closed

#![deny(missing_docs)] incompatible with #[clap(flatten)] #2108

jared-mackey opened this issue Aug 25, 2020 · 1 comment · Fixed by #2110
Assignees
Labels
A-derive Area: #[derive]` macro API C-bug Category: Updating dependencies
Milestone

Comments

@jared-mackey
Copy link

jared-mackey commented Aug 25, 2020

Code

use clap::Clap;

/// Docs included
#[derive(Clap)]
#[clap(author, version)]
struct Opts {
    /// Document debug
    #[clap(short, long)]
    debug: bool,

    /// Flatten
    #[clap(flatten)]
    thing: ThingConfig,

}

/// Thing CLI Configuration
#[derive(Clap)]
#[clap(name = "thing")]
struct ThingConfig {
    /// Thing URI
    #[clap(long)]
    uri: String,
}

Steps to reproduce the issue

  1. Run cargo build
  2. ???
  3. PROFIT!!!

Version

  • Rust: rustc 1.47.0-nightly (de521cbb3 2020-08-21)

  • Clap: "3.0.0-beta.1"

Actual Behavior Summary

When compiling with a doc on the flattened thing: ThingConfig

error: methods and doc comments are not allowed for flattened entry
  --> src/clapped.rs
   |
45 |     #[clap(flatten)]
   |            ^^^^^^^

When compiling without it (since I can't)

error: missing documentation for the crate

Expected Behavior Summary

Flattened options should not raise a missing docs warning.

@jared-mackey jared-mackey added the C-bug Category: Updating dependencies label Aug 25, 2020
@CreepySkeleton
Copy link
Contributor

I have recently fixed this in structopt but forgot to port the fix here. Will do ASAP

@CreepySkeleton CreepySkeleton self-assigned this Aug 25, 2020
@pksunkara pksunkara added the A-derive Area: #[derive]` macro API label Aug 25, 2020
@pksunkara pksunkara added this to the 3.0 milestone Aug 25, 2020
@bors bors bot closed this as completed in #2110 Aug 26, 2020
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.

3 participants