Skip to content

Methods of private traits require documentation according to the missing_doc lint #10069

Closed
@huonw

Description

@huonw

This is incorrect, it shouldn't complain since the trait is private.

#[deny(missing_doc)];
trait PrivateTrait {
    fn method(&self);
}
$ rustc --lib private-trait.rs
private-trait.rs:3:4: 3:20 error: missing documentation for a method
private-trait.rs:3     fn method(&self);
                       ^~~~~~~~~~~~~~~~
private-trait.rs:1:7: 1:18 note: lint level defined here
private-trait.rs:1 #[deny(missing_doc)];
                          ^~~~~~~~~~~
error: aborting due to previous error
task '<unnamed>' failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:98
task '<unnamed>' failed at 'explicit failure', /home/huon/rust/src/librustc/rustc.rs:395

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions