]> git.lizzy.rs Git - rust.git/blob - tests/ui/doc_errors.rs
Auto merge of #4809 - iankronquist:patch-1, r=flip1995
[rust.git] / tests / ui / doc_errors.rs
1 #![warn(clippy::missing_errors_doc)]
2
3 use std::io;
4
5 pub fn pub_fn_missing_errors_header() -> Result<(), ()> {
6     unimplemented!();
7 }
8
9 /// This is not sufficiently documented.
10 pub fn pub_fn_returning_io_result() -> io::Result<()> {
11     unimplemented!();
12 }
13
14 /// # Errors
15 /// A description of the errors goes here.
16 pub fn pub_fn_with_errors_header() -> Result<(), ()> {
17     unimplemented!();
18 }
19
20 /// This function doesn't require the documentation because it is private
21 fn priv_fn_missing_errors_header() -> Result<(), ()> {
22     unimplemented!();
23 }
24
25 pub struct Struct1;
26
27 impl Struct1 {
28     /// This is not sufficiently documented.
29     pub fn pub_method_missing_errors_header() -> Result<(), ()> {
30         unimplemented!();
31     }
32
33     /// # Errors
34     /// A description of the errors goes here.
35     pub fn pub_method_with_errors_header() -> Result<(), ()> {
36         unimplemented!();
37     }
38
39     /// This function doesn't require the documentation because it is private.
40     fn priv_method_missing_errors_header() -> Result<(), ()> {
41         unimplemented!();
42     }
43 }
44
45 pub trait Trait1 {
46     /// This is not sufficiently documented.
47     fn trait_method_missing_errors_header() -> Result<(), ()>;
48
49     /// # Errors
50     /// A description of the errors goes here.
51     fn trait_method_with_errors_header() -> Result<(), ()>;
52 }
53
54 impl Trait1 for Struct1 {
55     fn trait_method_missing_errors_header() -> Result<(), ()> {
56         unimplemented!();
57     }
58
59     fn trait_method_with_errors_header() -> Result<(), ()> {
60         unimplemented!();
61     }
62 }
63
64 fn main() -> Result<(), ()> {
65     Ok(())
66 }