]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/coverage/allow_missing_docs.rs
Rollup merge of #95449 - jyn514:doc-stage-0, r=ehuss
[rust.git] / src / test / rustdoc-ui / coverage / allow_missing_docs.rs
1 // compile-flags:-Z unstable-options --show-coverage
2 // check-pass
3
4 //! Make sure to have some docs on your crate root
5
6 #[allow(missing_docs)]
7 pub mod mod_foo {
8     pub struct Bar;
9 }
10
11 /// This is a struct with an `#[allow(missing_docs)]`
12 pub struct AllowTheMissingDocs {
13     #[allow(missing_docs)]
14     pub empty_str: String,
15
16     /// This has
17     #[allow(missing_docs)]
18     /// but also has documentation comments
19     pub hello: usize,
20
21     /// The doc id just to create a boilerplate comment
22     pub doc_id: Vec<u8>,
23 }
24
25 /// A function that has a documentation
26 pub fn this_is_func() {}
27
28 #[allow(missing_docs)]
29 pub struct DemoStruct {
30     something: usize,
31 }
32
33 #[allow(missing_docs)]
34 pub mod bar {
35     #[warn(missing_docs)]
36     pub struct Bar { //~ WARN
37         pub f: u32, //~ WARN
38     }
39
40     pub struct NeedsNoDocs;
41 }