rust/src/test/rustdoc-ui/lint-missing-doc-code-example.rs

41 lines
442 B
Rust
Raw Normal View History

2019-05-16 16:31:53 +00:00
#![deny(missing_docs)]
#![deny(missing_doc_code_examples)]
//! crate level doc
//! ```
//! println!("hello"):
//! ```
/// doc
///
/// ```
/// println!("hello");
/// ```
fn test() {
}
#[allow(missing_docs)]
2019-05-17 11:39:20 +00:00
mod module1 { //~ ERROR
2019-05-16 16:31:53 +00:00
}
#[allow(missing_doc_code_examples)]
/// doc
mod module2 {
/// doc
pub fn test() {}
}
/// doc
///
/// ```
/// println!("hello");
/// ```
pub mod module3 {
/// doc
2019-05-17 11:39:20 +00:00
//~^ ERROR
2019-05-16 16:31:53 +00:00
pub fn test() {}
}