]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/doc_errors.rs
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / doc_errors.rs
1 // edition:2018
2 #![warn(clippy::missing_errors_doc)]
3 #![allow(clippy::result_unit_err)]
4 #![allow(clippy::unnecessary_wraps)]
5
6 use std::io;
7
8 pub fn pub_fn_missing_errors_header() -> Result<(), ()> {
9     unimplemented!();
10 }
11
12 pub async fn async_pub_fn_missing_errors_header() -> Result<(), ()> {
13     unimplemented!();
14 }
15
16 /// This is not sufficiently documented.
17 pub fn pub_fn_returning_io_result() -> io::Result<()> {
18     unimplemented!();
19 }
20
21 /// This is not sufficiently documented.
22 pub async fn async_pub_fn_returning_io_result() -> io::Result<()> {
23     unimplemented!();
24 }
25
26 /// # Errors
27 /// A description of the errors goes here.
28 pub fn pub_fn_with_errors_header() -> Result<(), ()> {
29     unimplemented!();
30 }
31
32 /// # Errors
33 /// A description of the errors goes here.
34 pub async fn async_pub_fn_with_errors_header() -> Result<(), ()> {
35     unimplemented!();
36 }
37
38 /// This function doesn't require the documentation because it is private
39 fn priv_fn_missing_errors_header() -> Result<(), ()> {
40     unimplemented!();
41 }
42
43 /// This function doesn't require the documentation because it is private
44 async fn async_priv_fn_missing_errors_header() -> Result<(), ()> {
45     unimplemented!();
46 }
47
48 pub struct Struct1;
49
50 impl Struct1 {
51     /// This is not sufficiently documented.
52     pub fn pub_method_missing_errors_header() -> Result<(), ()> {
53         unimplemented!();
54     }
55
56     /// This is not sufficiently documented.
57     pub async fn async_pub_method_missing_errors_header() -> Result<(), ()> {
58         unimplemented!();
59     }
60
61     /// # Errors
62     /// A description of the errors goes here.
63     pub fn pub_method_with_errors_header() -> Result<(), ()> {
64         unimplemented!();
65     }
66
67     /// # Errors
68     /// A description of the errors goes here.
69     pub async fn async_pub_method_with_errors_header() -> Result<(), ()> {
70         unimplemented!();
71     }
72
73     /// This function doesn't require the documentation because it is private.
74     fn priv_method_missing_errors_header() -> Result<(), ()> {
75         unimplemented!();
76     }
77
78     /// This function doesn't require the documentation because it is private.
79     async fn async_priv_method_missing_errors_header() -> Result<(), ()> {
80         unimplemented!();
81     }
82 }
83
84 pub trait Trait1 {
85     /// This is not sufficiently documented.
86     fn trait_method_missing_errors_header() -> Result<(), ()>;
87
88     /// # Errors
89     /// A description of the errors goes here.
90     fn trait_method_with_errors_header() -> Result<(), ()>;
91 }
92
93 impl Trait1 for Struct1 {
94     fn trait_method_missing_errors_header() -> Result<(), ()> {
95         unimplemented!();
96     }
97
98     fn trait_method_with_errors_header() -> Result<(), ()> {
99         unimplemented!();
100     }
101 }
102
103 fn main() -> Result<(), ()> {
104     Ok(())
105 }