Skip to content

Commit 91095b1

Browse files
Update missing code example test
1 parent 4b30625 commit 91095b1

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
/// ```
1313
/// println!("hello");
1414
/// ```
15-
fn test() {
15+
pub fn test() {
1616
}
1717

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

2222
#[allow(rustdoc::missing_doc_code_examples)]
2323
/// doc
24-
mod module2 {
24+
pub mod module2 {
2525

2626
/// doc
2727
pub fn test() {}
@@ -63,9 +63,22 @@ pub enum Enum {
6363
/// Doc
6464
//~^ ERROR
6565
#[repr(C)]
66-
union Union {
66+
pub union Union {
6767
/// Doc, but no code example and it's fine!
6868
a: i32,
6969
/// Doc, but no code example and it's fine!
7070
b: f32,
7171
}
72+
73+
74+
#[doc(hidden)]
75+
pub mod foo {
76+
pub fn bar() {}
77+
}
78+
79+
fn babar() {}
80+
81+
82+
mod fofoo {
83+
pub fn tadam() {}
84+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: missing code example in this documentation
22
--> $DIR/lint-missing-doc-code-example.rs:19:1
33
|
4-
LL | / mod module1 {
4+
LL | / pub mod module1 {
55
LL | | }
66
| |_^
77
|

0 commit comments

Comments
 (0)