1 // aux-build: proc_macro_with_span.rs
3 #![warn(clippy::missing_docs_in_private_items)]
4 // When denying at the crate level, be sure to not get random warnings from the
5 // injected intrinsics by the compiler.
7 //! Some garbage docs for the crate here
8 #![doc = "More garbage"]
10 extern crate proc_macro_with_span;
12 use proc_macro_with_span::with_span;
13 use std::arch::global_asm;
15 type Typedef = String;
16 pub type PubTypedef = String;
19 pub mod pub_module_no_dox {}
25 #[allow(clippy::missing_docs_in_private_items)]
28 // It sure is nice if doc(hidden) implies allow(missing_docs), and that it
29 // applies recursively
39 BazA { a: isize, b: isize },
56 #[allow(clippy::missing_docs_in_private_items)]
58 PubBaz3A { b: isize },
66 pub const FOO1: u32 = 0;
67 #[allow(clippy::missing_docs_in_private_items)]
68 pub const FOO2: u32 = 0;
70 pub const FOO3: u32 = 0;
71 pub const FOO4: u32 = 0;
75 pub static BAR1: u32 = 0;
76 #[allow(clippy::missing_docs_in_private_items)]
77 pub static BAR2: u32 = 0;
79 pub static BAR3: u32 = 0;
80 pub static BAR4: u32 = 0;
84 pub fn documented() {}
85 pub fn undocumented1() {}
86 pub fn undocumented2() {}
91 pub fn also_documented() {}
92 pub fn also_undocumented1() {}
93 fn also_undocumented2() {}
97 pub mod public_interface {
98 pub use crate::internal_impl::documented as foo;
99 pub use crate::internal_impl::globbed::*;
100 pub use crate::internal_impl::undocumented1 as bar;
101 pub use crate::internal_impl::{documented, undocumented2};
106 // Ensure global asm doesn't require documentation.
109 // Don't lint proc macro output with an unexpected span.
110 with_span!(span pub struct FooPm { pub field: u32});
111 with_span!(span pub struct FooPm2;);
112 with_span!(span pub enum FooPm3 { A, B(u32), C { field: u32 }});
113 with_span!(span pub fn foo_pm() {});
114 with_span!(span pub static FOO_PM: u32 = 0;);
115 with_span!(span pub const FOO2_PM: u32 = 0;);