1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // When denying at the crate level, be sure to not get random warnings from the
12 // injected intrinsics by the compiler.
13 #![deny(missing_docs)]
15 #![feature(associated_type_defaults)]
17 //! Some garbage docs for the crate here
18 #![doc="More garbage"]
20 type Typedef
= String
;
21 pub type PubTypedef
= String
; //~ ERROR: missing documentation for a type alias
28 pub struct PubFoo
{ //~ ERROR: missing documentation for a struct
29 pub a
: isize, //~ ERROR: missing documentation for a struct field
33 #[allow(missing_docs)]
40 pub mod pub_module_no_dox {}
//~ ERROR: missing documentation for a module
44 pub fn foo2() {}
//~ ERROR: missing documentation for a function
46 #[allow(missing_docs)] pub fn foo4() {}
53 fn foo_with_impl(&self) {}
56 #[allow(missing_docs)]
59 fn foo_with_impl(&self) {}
62 pub trait C
{ //~ ERROR: missing documentation for a trait
63 fn foo(&self); //~ ERROR: missing documentation for a trait method
64 fn foo_with_impl(&self) {}
//~ ERROR: missing documentation for a trait method
67 #[allow(missing_docs)]
74 type AssociatedType
; //~ ERROR: missing documentation for an associated type
75 type AssociatedTypeDef
= Self; //~ ERROR: missing documentation for an associated type
80 type DocumentedTypeDef
= Self;
91 pub fn foo() {}
//~ ERROR: missing documentation for a method
95 #[allow(missing_docs)] pub fn foo3() {}
98 #[allow(missing_docs)]
104 // should need to redefine documentation for implementations of traits
110 // It sure is nice if doc(hidden) implies allow(missing_docs), and that it
111 // applies recursively
128 pub enum PubBaz
{ //~ ERROR: missing documentation for an enum
129 PubBazA
{ //~ ERROR: missing documentation for a variant
130 a
: isize, //~ ERROR: missing documentation for a struct field
143 #[allow(missing_docs)]
156 pub const FOO1
: u32 = 0;
157 #[allow(missing_docs)]
158 pub const FOO2
: u32 = 0;
160 pub const FOO3
: u32 = 0;
161 pub const FOO4
: u32 = 0; //~ ERROR: missing documentation for a const
166 pub static BAR1
: u32 = 0;
167 #[allow(missing_docs)]
168 pub static BAR2
: u32 = 0;
170 pub static BAR3
: u32 = 0;
171 pub static BAR4
: u32 = 0; //~ ERROR: missing documentation for a static
176 pub fn documented() {}
177 pub fn undocumented1() {}
//~ ERROR: missing documentation for a function
178 pub fn undocumented2() {}
//~ ERROR: missing documentation for a function
179 fn undocumented3() {}
183 pub fn also_documented() {}
184 pub fn also_undocumented1() {}
//~ ERROR: missing documentation for a function
185 fn also_undocumented2() {}
189 pub mod public_interface
{
190 pub use internal_impl
::documented
as foo
;
191 pub use internal_impl
::undocumented1
as bar
;
192 pub use internal_impl
::{documented, undocumented2}
;
193 pub use internal_impl
::globbed
::*;