Closed
Description
#![allow(unused_macros, dead_code)]
#[doc(hidden)]
const _: () = {
macro_rules! stry {
() => {};
}
struct ShouldBeHidden;
impl Bar for Foo {
fn bar(&self) {
struct SHouldAlsoBeHidden;
}
}
};
pub struct Foo;
pub trait Bar {
fn bar(&self);
}
Produces with rustdoc +nightly src/lib.rs --document-private-items
which erroniously includes stry
, ShouldBeHidden
, and ShouldAlsoBeHidden
.
Stable (1.66.0) gets this right
It's debatable what the semantics of --document-private-items
should be for items in blocks without #[doc(hidden)]
1, but here, we're just wrong.
We also can't just ignore all items in #[doc(hidden)]
blocks, as this would break a load of users, eg serde.
Probably, caused by #104889, cc @GuillaumeGomez
Footnotes
-
FWIW, I think they should still be hidden, as their not accessible outside the block. ↩