Skip to content

Methods are not shown for pub type that is imported from other crate #103004

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

Open
hellow554 opened this issue Oct 13, 2022 · 4 comments
Open

Methods are not shown for pub type that is imported from other crate #103004

hellow554 opened this issue Oct 13, 2022 · 4 comments
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@hellow554
Copy link
Contributor

Location

I searched for FatalError in the rustc docs: https://doc.rust-lang.org/nightly/nightly-rustc/?search=fatalerror
The first two results are the interesting ones: rustc_errors::FatalError and rustc_span::fatal_error::FatalError

When opening the rustc_span::fatal_error::FatalError page, the associated method raise is shown:
grafik

When opening the rustc_errors::FatalError, the method won't show up:
grafik

This looks like a bug to me, because you can call the public method through the public export, so that method should either be documented or a page forward should happen to the original struct.

@hellow554 hellow554 added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Oct 13, 2022
@fmease

This comment was marked as resolved.

@rustbot rustbot added A-local-reexports Area: Documentation that has been locally re-exported (i.e., non-cross-crate) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Oct 14, 2022
@kadiwa4
Copy link
Contributor

kadiwa4 commented Mar 1, 2024

Judging by the linked example, this has been fixed.
@rustbot label: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Mar 1, 2024
@fmease fmease added A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate and removed A-local-reexports Area: Documentation that has been locally re-exported (i.e., non-cross-crate) labels Sep 9, 2024
@fmease
Copy link
Member

fmease commented Sep 9, 2024

Triage 2024: Oof, it's quite hard to come up with an MCVE after the fact ^^'. That would've been useful for doing a bisection and for adding a regression test (or for checking if we already have a similar one).

I tried to reproduce it with nightly-2022-10-11 and nightly-2022-10-12 (based on the creation date of this issue and the fact that rustc's API docs get rebuilt 'nightly').

I tried a two file setup of the form:

// span.rs
pub mod fatal_error {
    pub struct FatalError;

    impl FatalError {
        pub fn raise(self) -> ! { loop {} }
    }
}

rustc +nightly-2022-10-12 span.rs --crate-type lib --edition 2021

// error.rs
pub use span::fatal_error::FatalError;

rustdoc +nightly-2022-10-12 error.rs --edition 2021 -Lcrate=. --extern span

@fmease
Copy link
Member

fmease commented Sep 9, 2024

I know that Guillaume fixed a bunch of reexport issues earlier this year and late last year but I'm not super sure how to proceed with this specific issue at this time.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 10, 2024
…=notriddle

rustdoc: add two regression tests

They were basically copy/pasted from `tests/ui/` to `tests/rustdoc-ui/`.
Not sure if it's worth adding these, I can just close these issues as is if you want.

This brings the number of https://github.com/rust-lang/rust/labels/T-rustdoc + https://github.com/rust-lang/rust/labels/E-needs-test from 3 down to 1.
The remaining one – rust-lang#103004 — is a nasty one to retroactively find a proper(!) test for.

Fixes rust-lang#98250.
Fixes rust-lang#107872.

r? rustdoc
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 10, 2024
Rollup merge of rust-lang#130173 - fmease:rustdoc-regression-tests, r=notriddle

rustdoc: add two regression tests

They were basically copy/pasted from `tests/ui/` to `tests/rustdoc-ui/`.
Not sure if it's worth adding these, I can just close these issues as is if you want.

This brings the number of https://github.com/rust-lang/rust/labels/T-rustdoc + https://github.com/rust-lang/rust/labels/E-needs-test from 3 down to 1.
The remaining one – rust-lang#103004 — is a nasty one to retroactively find a proper(!) test for.

Fixes rust-lang#98250.
Fixes rust-lang#107872.

r? rustdoc
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. 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

4 participants