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: regression in intra-doc link to trait function #92662

Closed
rnarubin opened this issue Jan 8, 2022 · 3 comments · Fixed by #92792
Closed

Rustdoc: regression in intra-doc link to trait function #92662

rnarubin opened this issue Jan 8, 2022 · 3 comments · Fixed by #92792
Assignees
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Milestone

Comments

@rnarubin
Copy link

rnarubin commented Jan 8, 2022

Code

Example code:

#![deny(rustdoc::broken_intra_doc_links)]

use std::marker::PhantomData;

pub trait Bar<T> {
    fn bar(&self);
}

pub struct Foo<U>(PhantomData<U>);

impl<T, U> Bar<T> for Foo<U> {
    fn bar(&self) {}
}

/// link to [`Foo::bar`]
fn main() {}

Version it worked on

docs build successfully on 1.57.0:

$ cargo +1.57.0 --version
cargo 1.57.0 (b2e52d7ca 2021-10-21)
$ cargo +1.57.0 doc
 Documenting trait-link-example v0.1.0 (/tmp/trait-link-example)
    Finished dev [unoptimized + debuginfo] target(s) in 0.53s

Version with regression

docs fail to build on 1.59.0-nightly (358e79fe5 2022-01-04):

$ cargo +nightly-2022-01-07 --version
cargo 1.59.0-nightly (358e79fe5 2022-01-04)
$ cargo +nightly-2022-01-07 doc
 Documenting trait-link-example v0.1.0 (/tmp/trait-link-example)
error: unresolved link to `Foo::bar`
  --> src/main.rs:15:15
   |
15 | /// link to [`Foo::bar`]
   |               ^^^^^^^^ the struct `Foo` has no field or associated item named `bar`
   |
note: the lint level is defined here
  --> src/main.rs:1:9
   |
1  | #![deny(rustdoc::broken_intra_doc_links)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not document `trait-link-example`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type bin --crate-name trait_link_example src/main.rs -o /tmp/trait-link-example/target/doc --error-format=json --json=diagnostic-rendered-ansi,future-incompat --document-private-items -C metadata=af2f029e3f5db9a3 -L dependency=/tmp/trait-link-example/target/debug/deps --crate-version 0.1.0` (exit status: 1)

The generics appear necessary for the bug. Removing them from either the type or the trait resolves the failure.

@rnarubin rnarubin added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Jan 8, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 8, 2022
@camelid
Copy link
Member

camelid commented Jan 8, 2022

Probably #92443.


searched nightlies: from nightly-2022-01-06 to nightly-2022-01-07
regressed nightly: nightly-2022-01-07
searched commit range: f1ce0e6...cfa4ac6
regressed commit: cfa4ac6

bisected with cargo-bisect-rustc v0.6.1

Host triple: aarch64-apple-darwin
Reproduce with:

cargo bisect-rustc --preserve --start=2022-01-06 --end=2022-01-07 --regress=error -- doc

rnarubin added a commit to standard-ai/ya-gcp that referenced this issue Jan 10, 2022
A regression in rustdocs is causing some errors[1]. While that gets sorted,
use a version of rustdocs that won't fail.

[1] rust-lang/rust#92662
rnarubin added a commit to standard-ai/ya-gcp that referenced this issue Jan 10, 2022
A regression in rustdocs is causing some errors[1]. While that gets sorted,
use a version of rustdocs that won't fail.

[1] rust-lang/rust#92662
@mdibaiee
Copy link
Contributor

@camelid just saw this, I think might be caused by this change:

https://github.com/rust-lang/rust/pull/92443/files#diff-53e2bb31a1a4804925f22caf5a4844d0b6ffc9f7f307d93ef6098d62381a5085R891

I'm looking into it 🤔

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 12, 2022
@camelid camelid added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-untriaged Untriaged performance or correctness regression. labels Jan 13, 2022
@camelid camelid added this to the 1.59.0 milestone Jan 13, 2022
@camelid camelid added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 13, 2022
@mdibaiee
Copy link
Contributor

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 15, 2022
…cs, r=camelid

rustdoc: fix intra-link for generic trait impls

fixes rust-lang#92662

r? `@camelid`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 15, 2022
…cs, r=camelid

rustdoc: fix intra-link for generic trait impls

fixes rust-lang#92662

r? ``@camelid``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 15, 2022
…cs, r=camelid

rustdoc: fix intra-link for generic trait impls

fixes rust-lang#92662

r? ```@camelid```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 15, 2022
…cs, r=camelid

rustdoc: fix intra-link for generic trait impls

fixes rust-lang#92662

r? ````@camelid````
@bors bors closed this as completed in 682ad02 Jan 16, 2022
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. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants