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