]> git.lizzy.rs Git - rust.git/blob - tests/ui/missing-doc-impl.rs
Merge remote-tracking branch 'upstream/beta' into backport_remerge
[rust.git] / 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     #[must_use = "yep"]
71     fn foo2() -> u32 {
72         1
73     }
74     #[allow(clippy::missing_docs_in_private_items)]
75     pub fn foo3() {}
76 }
77
78 #[allow(clippy::missing_docs_in_private_items)]
79 trait F {
80     fn a();
81     fn b(&self);
82 }
83
84 // should need to redefine documentation for implementations of traits
85 impl F for Foo {
86     fn a() {}
87     fn b(&self) {}
88 }
89
90 fn main() {}