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