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 generates broken "Read more" links when the destination crate doesn't have a URL #74222

Open
ollie27 opened this issue Jul 10, 2020 · 0 comments
Assignees
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

@ollie27
Copy link
Member

ollie27 commented Jul 10, 2020

I tried this code:

foo.rs:

#![crate_type = "rlib"]
pub struct FooStruct;
pub trait FooTrait {
    /// docs
    ///
    /// more docs
    fn foo_method();
}
impl FooTrait for FooStruct {
    fn foo_method() {}
}

bar.rs:

extern crate foo;
pub use foo::FooStruct;

running rustc foo.rs && rustdoc -L . bar.rs so only bar is documented.

I expected to see this happen:

When the docs for bar are documented the page for FooStruct shouldn't contain any broken "Read more" links.

Instead, this happened:

The "Read more" link for foo_method on the page for FooStruct points to #tymethod.foo_method which doesn't go anywhere. It should point to the documentation for FooTrait but as that page doesn't exist the "Read more" link shouldn't exist at all. The link works fine if docs for foo are also generated or pub use foo::FooTrait; is added to bar.rs.

Meta

rustc --version --verbose:

rustc 1.46.0-nightly (5db778aff 2020-07-09)
binary: rustc
commit-hash: 5db778affee7c6600c8e7a177c48282dab3f6292
commit-date: 2020-07-09
host: x86_64-pc-windows-msvc
release: 1.46.0-nightly
LLVM version: 10.0
@ollie27 ollie27 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jul 10, 2020
@ollie27 ollie27 self-assigned this Jul 10, 2020
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

1 participant