-
Notifications
You must be signed in to change notification settings - Fork 13.4k
#[doc(hidden)]
doesn't work on module or crate re-exports
#83939
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Luckily, there is an easy workaround: a |
#[doc(hidden)]
doesn't work on module re-exports#[doc(hidden)]
doesn't work on module or crate re-exports
@jplatte your example doesn't compile: error[E0365]: `foo` is private, and cannot be re-exported
--> inline.rs:6:9
|
6 | pub use foo as bar;
| ^^^^^^^^^^ re-export of private `foo`
|
= note: consider declaring type or module `foo` with `pub`
error: extern crate `std` is private, and cannot be re-exported (error E0365), consider declaring with `pub`
--> inline.rs:9:9
|
9 | pub use std as _std;
| ^^^^^^^^^^^
|
= note: `#[deny(pub_use_of_private_extern_crate)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> |
Sorry, fixed the module part of the example. But re-exporting an external crate should always work, no? Is that error new? |
@jplatte now it compiles, but rustdoc hides all the examples as I'd expect:
See #34537, I don't have opinions. Rustdoc doesn't emit that lint which I consider a bug, working on a PR for that now. |
Okay, found out why my minimum example is wrong: This bug needs another re-export level to trigger. So I guess it's a duplicate of #53417. |
Uh oh!
There was an error while loading. Please reload this page.
Minimal reproduction:
I expected to see this happen: No docs for the
#[doc(hidden)]
re-exportsInstead, this happened: Both re-exports show up in the generated doc page
Meta
rustc --version --verbose
:rustc +nightly --version --verbose
:The text was updated successfully, but these errors were encountered: