Skip to content

Commit c78af2b

Browse files
Update rustdoc-ui tests
1 parent b5d4bd2 commit c78af2b

4 files changed

+38
-8
lines changed

src/test/rustdoc-ui/doc-without-codeblock.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//~ ERROR Missing code example in this documentation
2-
3-
#![deny(missing_doc_code_examples)]
1+
#![deny(missing_doc_code_examples)] //~ ERROR Missing code example in this documentation
42

53
/// Some docs.
64
//~^ ERROR Missing code example in this documentation

src/test/rustdoc-ui/doc-without-codeblock.stderr

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
error: Missing code example in this documentation
2+
--> $DIR/doc-without-codeblock.rs:1:1
3+
|
4+
LL | / #![deny(missing_doc_code_examples)]
5+
LL | |
6+
LL | | /// Some docs.
7+
LL | |
8+
... |
9+
LL | | pub fn bar() {}
10+
LL | | }
11+
| |_^
212
|
313
note: lint level defined here
4-
--> $DIR/doc-without-codeblock.rs:3:9
14+
--> $DIR/doc-without-codeblock.rs:1:9
515
|
616
LL | #![deny(missing_doc_code_examples)]
717
| ^^^^^^^^^^^^^^^^^^^^^^^^^
818

919
error: Missing code example in this documentation
10-
--> $DIR/doc-without-codeblock.rs:5:1
20+
--> $DIR/doc-without-codeblock.rs:3:1
1121
|
1222
LL | /// Some docs.
1323
| ^^^^^^^^^^^^^^
1424

1525
error: Missing code example in this documentation
16-
--> $DIR/doc-without-codeblock.rs:9:1
26+
--> $DIR/doc-without-codeblock.rs:7:1
1727
|
1828
LL | /// And then, the princess died.
1929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2030

2131
error: Missing code example in this documentation
22-
--> $DIR/doc-without-codeblock.rs:12:5
32+
--> $DIR/doc-without-codeblock.rs:10:5
2333
|
2434
LL | /// Or maybe not because she saved herself!
2535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/rustdoc-ui/lint-missing-doc-code-example.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn test() {
1616
}
1717

1818
#[allow(missing_docs)]
19-
mod module1 {
19+
mod module1 { //~ ERROR
2020
}
2121

2222
#[allow(missing_doc_code_examples)]
@@ -35,5 +35,6 @@ mod module2 {
3535
pub mod module3 {
3636

3737
/// doc
38+
//~^ ERROR
3839
pub fn test() {}
3940
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error: Missing code example in this documentation
2+
--> $DIR/lint-missing-doc-code-example.rs:19:1
3+
|
4+
LL | / mod module1 {
5+
LL | | }
6+
| |_^
7+
|
8+
note: lint level defined here
9+
--> $DIR/lint-missing-doc-code-example.rs:2:9
10+
|
11+
LL | #![deny(missing_doc_code_examples)]
12+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
13+
14+
error: Missing code example in this documentation
15+
--> $DIR/lint-missing-doc-code-example.rs:37:3
16+
|
17+
LL | /// doc
18+
| ^^^^^^^
19+
20+
error: aborting due to 2 previous errors
21+

0 commit comments

Comments
 (0)