rustdoc: be more strict about "Methods from Deref" by lolbinarycat · Pull Request #138574 · rust-lang/rust (original) (raw)

lolbinarycat

@rustbot

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

T-rustdoc-frontend

Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

labels

Mar 16, 2025

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

GuillaumeGomez

GuillaumeGomez

pub fn get_u32(&self) -> u32 { self.0 }
}
// Note that the same href is used both on the method itself,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it an issue?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, since we're testing that it appears twice, and in any case, we care about the negative case much more, which will trigger if the bad method shows up in the sidebar or on the main page.

@rust-log-analyzer

This comment has been minimized.

GuillaumeGomez

@GuillaumeGomez

Thanks for the fix! Squash your commits then r=me.

@lolbinarycat @GuillaumeGomez

hack: is_doc_subtype_of always returns true for TyAlias

it's worth noting that this function is only used in the handling of "Methods from Deref", and we were previously assuming all generic parameters were meaningless, so this is still an improvment from the status quo.

this change means that we will have strictly less false positives without adding any new false negitives.

Co-authored-by: Guillaume Gomez guillaume1.gomez@gmail.com

@lolbinarycat

r=@GuillaumeGomez

(still don't have bors perms so I doubt the r= is going to do anything)

@notriddle

@bors

📌 Commit b46412f has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Mar 22, 2025

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 24, 2025

@bors

Rollup of 10 pull requests

Successful merges:

Failed merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 24, 2025

@rust-timer

Rollup merge of rust-lang#138574 - lolbinarycat:rustdoc-deref-24686-v2, r=GuillaumeGomez

rustdoc: be more strict about "Methods from Deref"

fixes rust-lang#137083 fixes rust-lang#24686

Currently done:

Note that this does not yet fix the sidebar logic.