]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/missing-doc-impl.rs
57af84dcdf4d0905c9235821335a672980d214b4
[rustc.git] / src / tools / clippy / tests / ui / missing-doc-impl.rs
1 #![warn(clippy::missing_docs_in_private_items)]
2 #![allow(dead_code)]
3 #![feature(associated_type_defaults)]
4
5 //! Some garbage docs for the crate here
6 #![doc = "More garbage"]
7
8 struct Foo {
9 a: isize,
10 b: isize,
11 }
12
13 pub struct PubFoo {
14 pub a: isize,
15 b: isize,
16 }
17
18 #[allow(clippy::missing_docs_in_private_items)]
19 pub struct PubFoo2 {
20 pub a: isize,
21 pub c: isize,
22 }
23
24 /// dox
25 pub trait A {
26 /// dox
27 fn foo(&self);
28 /// dox
29 fn foo_with_impl(&self) {}
30 }
31
32 #[allow(clippy::missing_docs_in_private_items)]
33 trait B {
34 fn foo(&self);
35 fn foo_with_impl(&self) {}
36 }
37
38 pub trait C {
39 fn foo(&self);
40 fn foo_with_impl(&self) {}
41 }
42
43 #[allow(clippy::missing_docs_in_private_items)]
44 pub trait D {
45 fn dummy(&self) {}
46 }
47
48 /// dox
49 pub trait E: Sized {
50 type AssociatedType;
51 type AssociatedTypeDef = Self;
52
53 /// dox
54 type DocumentedType;
55 /// dox
56 type DocumentedTypeDef = Self;
57 /// dox
58 fn dummy(&self) {}
59 }
60
61 impl Foo {
62 pub fn foo() {}
63 fn bar() {}
64 }
65
66 impl PubFoo {
67 pub fn foo() {}
68 /// dox
69 pub fn foo1() {}
70 fn foo2() {}
71 #[allow(clippy::missing_docs_in_private_items)]
72 pub fn foo3() {}
73 }
74
75 #[allow(clippy::missing_docs_in_private_items)]
76 trait F {
77 fn a();
78 fn b(&self);
79 }
80
81 // should need to redefine documentation for implementations of traits
82 impl F for Foo {
83 fn a() {}
84 fn b(&self) {}
85 }
86
87 fn main() {}