Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: macro export in doc hidden mod inlines macro on pub use #106713

Closed
kloenk opened this issue Jan 11, 2023 · 2 comments
Closed

rustdoc: macro export in doc hidden mod inlines macro on pub use #106713

kloenk opened this issue Jan 11, 2023 · 2 comments
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kloenk
Copy link

kloenk commented Jan 11, 2023

I tried this code:

#[doc(hidden)]
mod crate_macro {
    #[macro_export]
    macro_rules! vec {
        ( $( $x:expr ),* ) => {};
    }
}
pub mod prelude {
    pub use crate::vec;
}

I expected to see this happen:
In the Cargo doc rendering of the prelude module vec! should be a reexport of crate::vec, as it is, if doc hidden is not set

Instead, this happened:
vec! is inlined in the prelude module

Meta

rustc --version --verbose:

rustc 1.66.1 (90743e729 2023-01-10)

This sounds similar to #59368 but is slightly different, as the module of the macro is hidden, and not the macro.

@kloenk kloenk added the C-bug Category: This is a bug. label Jan 11, 2023
@GuillaumeGomez
Copy link
Member

The reexport is not hidden so that seems like the expected behaviour to me.

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 11, 2023
ojeda pushed a commit to ojeda/linux that referenced this issue Jan 16, 2023
This shows exactly where the items are from, previously the items from
macros, alloc and core were shown as a declaration from the kernel crate,
this shows the correct path.

Link: rust-lang/rust#106713
Signed-off-by: Finn Behrens <fin@nyantec.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
[Reworded to add Link, fixed two typos and comment style]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@GuillaumeGomez
Copy link
Member

Closing then.

jannau pushed a commit to jannau/linux that referenced this issue Mar 9, 2023
This shows exactly where the items are from, previously the items from
macros, alloc and core were shown as a declaration from the kernel crate,
this shows the correct path.

Link: rust-lang/rust#106713
Signed-off-by: Finn Behrens <fin@nyantec.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
[Reworded to add Link, fixed two typos and comment style]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants