Closed
Description
Hello,
consider this code example:
#![deny(missing_docs)]
#![deny(missing_doc_code_examples)]
//! crate level doc
//! ```
//! println!("hello"):
//! ```
/// doc
///
/// ```
/// println!("hello");
/// ```
fn test() {
}
// the allow() here works as expected, but missing_doc_code_examples still complains
#[allow(missing_docs)]
mod module1 {
fn test() {}
}
// here we want some docs but no code examples, but missing_doc_code_examples still complains
#[allow(missing_doc_code_examples)]
/// doc
mod module2 {
/// doc
fn test() {}
}
/// doc
///
/// ```
/// println!("hello");
/// ```
mod module3 {
// here we want some code examples but missing_doc_code_examples does not complain
/// doc
fn test() {}
}
Here I would expect the following behaviour when running cargo doc
:
module1
hasallow(missing_docs)
somissing_doc_code_examples
should be silentmodule2
hasallow(missing_doc_code_examples)
yet we still get errors for missing docs onmodule2
, I think we should notmodule3
has a code example, butmodule3::test
does not, we should get an error for the missing example onmodule3::test