Closed
Description
I wanted to try out the missing_doc_code_examples rustdoc lint, but it seems to
be bugged.
I tried following the example given in the book.
Steps to reproduce:
Create a new crate:
cargo new testmissingdocs
Then edit the src/main.rs file:
#![deny(missing_doc_code_examples)]
//! Top level crate documentation
fn main() {
println!("Hello, world!");
}
/// This function has no code examples.
pub fn add(i: i32, j: i32) -> i32 {
i + j
}
I would now expect to get a linting error when building the crate, since the add
function is public, but does not have a code example. However, cargo build
as
well as cargo doc
and cargo test --doc
completes without any errors.
Metadata
Metadata
Assignees
Labels
Area: Documentation for any part of the project, including the compiler, standard library, and toolsCategory: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the rustdoc team, which will review and decide on the PR/issue.