2022-09-12 20:10:35 +02:00
|
|
|
#![feature(rustdoc_missing_doc_code_examples)]
|
2019-05-16 18:31:53 +02:00
|
|
|
#![deny(missing_docs)]
|
2020-12-30 05:16:16 +01:00
|
|
|
#![deny(rustdoc::missing_doc_code_examples)]
|
2019-05-16 18:31:53 +02:00
|
|
|
|
|
|
|
//! crate level doc
|
|
|
|
//! ```
|
|
|
|
//! println!("hello"):
|
|
|
|
//! ```
|
|
|
|
|
|
|
|
|
|
|
|
/// doc
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// println!("hello");
|
|
|
|
/// ```
|
2021-02-13 21:45:15 +01:00
|
|
|
pub fn test() {
|
2019-05-16 18:31:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(missing_docs)]
|
2021-02-13 21:45:15 +01:00
|
|
|
pub mod module1 { //~ ERROR
|
2019-05-16 18:31:53 +02:00
|
|
|
}
|
|
|
|
|
2020-12-30 05:16:16 +01:00
|
|
|
#[allow(rustdoc::missing_doc_code_examples)]
|
2019-05-16 18:31:53 +02:00
|
|
|
/// doc
|
2021-02-13 21:45:15 +01:00
|
|
|
pub mod module2 {
|
2019-05-16 18:31:53 +02:00
|
|
|
|
|
|
|
/// doc
|
|
|
|
pub fn test() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// doc
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// println!("hello");
|
|
|
|
/// ```
|
|
|
|
pub mod module3 {
|
|
|
|
|
|
|
|
/// doc
|
2019-05-17 13:39:20 +02:00
|
|
|
//~^ ERROR
|
2019-05-16 18:31:53 +02:00
|
|
|
pub fn test() {}
|
|
|
|
}
|
2020-08-21 18:05:51 +02:00
|
|
|
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
pub const Const: u32 = 0;
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
pub static Static: u32 = 0;
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
pub type Type = u32;
|
|
|
|
|
|
|
|
/// Doc
|
|
|
|
//~^ ERROR
|
|
|
|
pub struct Struct {
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
pub field: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Doc
|
|
|
|
//~^ ERROR
|
|
|
|
pub enum Enum {
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
X,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Doc
|
|
|
|
//~^ ERROR
|
|
|
|
#[repr(C)]
|
2021-02-13 21:45:15 +01:00
|
|
|
pub union Union {
|
2020-08-21 18:05:51 +02:00
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
a: i32,
|
|
|
|
/// Doc, but no code example and it's fine!
|
|
|
|
b: f32,
|
|
|
|
}
|
2021-02-13 21:45:15 +01:00
|
|
|
|
2021-09-08 16:03:15 +02:00
|
|
|
// no code example and it's fine!
|
|
|
|
impl Clone for Struct {
|
|
|
|
fn clone(&self) -> Self {
|
|
|
|
Self { field: self.field }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-13 21:45:15 +01:00
|
|
|
|
2021-09-08 01:09:15 +02:00
|
|
|
|
|
|
|
/// doc
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// println!("hello");
|
|
|
|
/// ```
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct NiceStruct;
|
|
|
|
|
2021-02-13 21:45:15 +01:00
|
|
|
#[doc(hidden)]
|
|
|
|
pub mod foo {
|
|
|
|
pub fn bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn babar() {}
|
|
|
|
|
|
|
|
|
|
|
|
mod fofoo {
|
|
|
|
pub fn tadam() {}
|
|
|
|
}
|