Skip to content

missing_docs does not trigger for types only used in exported fields of enumerations #39162

Open
@mathstuf

Description

@mathstuf

IMO, this should be a compilation failure because although Foo is not explicitly exported, it is publicly visible via the Bar::A variant:

lib.rs:

#![deny(missing_docs)]

mod types;

pub use types::Bar;

types.rs:

pub struct Foo;

/// A bar.
pub enum Bar {
    /// A `Bar` variant.
    A(Foo),
}

Oddly enough, it seems to also be happy with the missing crate-level docs…

Using 1.14.0 (from Fedora's repository).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-missing_docsLint: missing_docsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions