Skip to content

Commit fca3774

Browse files
committed
Add doc_markdown checks
1 parent cbaecb6 commit fca3774

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

tests/ui/doc_errors.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,29 @@ impl Struct1 {
8282
unimplemented!();
8383
}
8484

85+
/**
86+
# Errors
87+
This is sufficiently documented.
88+
89+
This function is a test for this lint's capabilities with other
90+
lints, such as `doc_markdown`
91+
std::str;
92+
*/
93+
pub fn pub_method_block_errors_header_doc_markdown() -> Result<(), ()> {
94+
unimplemented!();
95+
}
96+
97+
/**
98+
This is not sufficiently documented.
99+
100+
This function is also a test for this lint's capabilities with other
101+
lints, such as `doc_markdown`
102+
std::str;
103+
*/
104+
pub fn pub_method_missing_block_errors_header_doc_markdown() -> Result<(), ()> {
105+
unimplemented!();
106+
}
107+
85108
/// # Errors
86109
/// A description of the errors goes here.
87110
pub async fn async_pub_method_with_errors_header() -> Result<(), ()> {

tests/ui/doc_errors.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ LL | pub fn pub_method_missing_block_errors_header() -> Result<(), ()> {
4545
error: docs for function returning `Result` missing `# Errors` section
4646
--> $DIR/doc_errors.rs:104:5
4747
|
48+
LL | pub fn pub_method_missing_block_errors_header_doc_markdown() -> Result<(), ()> {
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
51+
error: docs for function returning `Result` missing `# Errors` section
52+
--> $DIR/doc_errors.rs:127:5
53+
|
4854
LL | fn trait_method_missing_errors_header() -> Result<(), ()>;
4955
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5056

51-
error: aborting due to 8 previous errors
57+
error: aborting due to 9 previous errors
5258

0 commit comments

Comments
 (0)