Skip to content

Commit aa7e470

Browse files
Add test for #108570.
Update UI test with new output.
1 parent f9f4f58 commit aa7e470

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/108570>.
2+
// If a `#[doc(hidden)]` item is re-exported or if a private item is re-exported
3+
// with a `#[doc(hidden)]` re-export, it shouldn't complain.
4+
5+
// check-pass
6+
7+
#![crate_type = "lib"]
8+
9+
mod priv_mod {
10+
pub struct Foo;
11+
#[doc(hidden)]
12+
pub struct Bar;
13+
}
14+
15+
#[doc(hidden)]
16+
pub use priv_mod::Foo;
17+
pub use priv_mod::Bar;

tests/ui/lint/lint-missing-doc.stderr

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,36 @@ error: missing documentation for a function
117117
|
118118
LL | pub fn undocumented1() {}
119119
| ^^^^^^^^^^^^^^^^^^^^^^
120+
|
121+
note: because it is re-exported here
122+
--> $DIR/lint-missing-doc.rs:183:5
123+
|
124+
LL | pub use internal_impl::undocumented1 as bar;
125+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120126

121127
error: missing documentation for a function
122128
--> $DIR/lint-missing-doc.rs:170:5
123129
|
124130
LL | pub fn undocumented2() {}
125131
| ^^^^^^^^^^^^^^^^^^^^^^
132+
|
133+
note: because it is re-exported here
134+
--> $DIR/lint-missing-doc.rs:184:41
135+
|
136+
LL | pub use internal_impl::{documented, undocumented2};
137+
| ^^^^^^^^^^^^^
126138

127139
error: missing documentation for a function
128140
--> $DIR/lint-missing-doc.rs:176:9
129141
|
130142
LL | pub fn also_undocumented1() {}
131143
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
144+
|
145+
note: because it is re-exported here
146+
--> $DIR/lint-missing-doc.rs:185:5
147+
|
148+
LL | pub use internal_impl::globbed::*;
149+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132150

133151
error: missing documentation for a function
134152
--> $DIR/lint-missing-doc.rs:191:5

tests/ui/privacy/auxiliary/ctor_aux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Use the lint to additionally verify that items are reachable
44
//! but not exported.
55
#![allow(non_camel_case_types)]
6-
#![deny(missing_docs)]
6+
// #![deny(missing_docs)]
77

88
mod hidden {
99
pub struct s;

0 commit comments

Comments
 (0)