1 // When denying at the crate level, be sure to not get random warnings from the
2 // injected intrinsics by the compiler.
5 #![feature(associated_type_defaults)]
7 //! Some garbage docs for the crate here
10 type Typedef
= String
;
11 pub type PubTypedef
= String
; //~ ERROR: missing documentation for a type alias
18 pub struct PubFoo
{ //~ ERROR: missing documentation for a struct
19 pub a
: isize, //~ ERROR: missing documentation for a struct field
23 #[allow(missing_docs)]
30 pub mod pub_module_no_dox {}
//~ ERROR: missing documentation for a module
34 pub fn foo2() {}
//~ ERROR: missing documentation for a function
36 #[allow(missing_docs)] pub fn foo4() {}
43 fn foo_with_impl(&self) {}
46 #[allow(missing_docs)]
49 fn foo_with_impl(&self) {}
52 pub trait C
{ //~ ERROR: missing documentation for a trait
53 fn foo(&self); //~ ERROR: missing documentation for a trait method
54 fn foo_with_impl(&self) {}
//~ ERROR: missing documentation for a trait method
57 #[allow(missing_docs)]
64 type AssociatedType
; //~ ERROR: missing documentation for an associated type
65 type AssociatedTypeDef
= Self; //~ ERROR: missing documentation for an associated type
70 type DocumentedTypeDef
= Self;
81 pub fn foo() {}
//~ ERROR: missing documentation for a method
85 #[allow(missing_docs)] pub fn foo3() {}
88 #[allow(missing_docs)]
94 // should need to redefine documentation for implementations of traits
100 // It sure is nice if doc(hidden) implies allow(missing_docs), and that it
101 // applies recursively
118 pub enum PubBaz
{ //~ ERROR: missing documentation for an enum
119 PubBazA
{ //~ ERROR: missing documentation for a variant
120 a
: isize, //~ ERROR: missing documentation for a struct field
133 #[allow(missing_docs)]
146 pub const FOO1
: u32 = 0;
147 #[allow(missing_docs)]
148 pub const FOO2
: u32 = 0;
150 pub const FOO3
: u32 = 0;
151 pub const FOO4
: u32 = 0; //~ ERROR: missing documentation for a const
156 pub static BAR1
: u32 = 0;
157 #[allow(missing_docs)]
158 pub static BAR2
: u32 = 0;
160 pub static BAR3
: u32 = 0;
161 pub static BAR4
: u32 = 0; //~ ERROR: missing documentation for a static
166 pub fn documented() {}
167 pub fn undocumented1() {}
//~ ERROR: missing documentation for a function
168 pub fn undocumented2() {}
//~ ERROR: missing documentation for a function
169 fn undocumented3() {}
173 pub fn also_documented() {}
174 pub fn also_undocumented1() {}
//~ ERROR: missing documentation for a function
175 fn also_undocumented2() {}
179 pub mod public_interface
{
180 pub use internal_impl
::documented
as foo
;
181 pub use internal_impl
::undocumented1
as bar
;
182 pub use internal_impl
::{documented, undocumented2}
;
183 pub use internal_impl
::globbed
::*;