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: fix self cmp #134214

Merged
merged 1 commit into from
Dec 12, 2024
Merged

rustdoc: fix self cmp #134214

merged 1 commit into from
Dec 12, 2024

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Dec 12, 2024

Looks like condition in filter currently always true, but intended to compare with fqp from if let Some(&(ref fqp, item_type))?

@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2024

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. labels Dec 12, 2024
@klensy
Copy link
Contributor Author

klensy commented Dec 12, 2024

if let Some(&(ref fqp, item_type)) =
paths.get(&defid).or_else(|| external_paths.get(&defid))
{
let exact_fqp = exact_paths
.get(&defid)
.or_else(|| external_paths.get(&defid).map(|(fqp, _)| fqp))
// Re-exports only count if the name is exactly the same.
// This is a size optimization, since it means we only need
// to store the name once (and the path is re-used for everything
// exported from this same module). It's also likely to Do
// What I Mean, since if a re-export changes the name, it might
// also be a change in semantic meaning.
.filter(|fqp| fqp.last() == fqp.last());

compare fqp from line 192 with fqp from closure on line 204.

@notriddle
Copy link
Contributor

Ouch, good catch.

Any idea if this causes any visible bugs?

@klensy
Copy link
Contributor Author

klensy commented Dec 12, 2024

Ouch, good catch.

Any idea if this causes any visible bugs?

Idk, waiting test results.

@notriddle
Copy link
Contributor

I see it didn't break anything.

@bors r+

@bors
Copy link
Contributor

bors commented Dec 12, 2024

📌 Commit 86a4a27 has been approved by notriddle

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 Dec 12, 2024
@@ -201,7 +201,7 @@ pub(crate) fn build_index(
// exported from this same module). It's also likely to Do
// What I Mean, since if a re-export changes the name, it might
// also be a change in semantic meaning.
.filter(|fqp| fqp.last() == fqp.last());
.filter(|this_fqp| this_fqp.last() == fqp.last());
Copy link
Contributor

Choose a reason for hiding this comment

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

there's another filter that's the inverse of this at line 212

Copy link
Contributor

Choose a reason for hiding this comment

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

Not actually the same. This one only checks the last path component. The one on 212 checks the entire path.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahhh indeed

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133122 (Add unpolished, experimental support for AFIDT (async fn in dyn trait))
 - rust-lang#133249 (ABI checks: add support for loongarch)
 - rust-lang#134089 (Use newly added exceptions to non default branch warning)
 - rust-lang#134188 (Bump Fuchsia)
 - rust-lang#134204 (Fix our `llvm::Bool` typedef to be signed, to match `LLVMBool`)
 - rust-lang#134207 (Revert "bootstrap: print{ln}! -> eprint{ln}! (take 2) rust-lang#134040")
 - rust-lang#134214 (rustdoc: fix self cmp)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2024
Rollup merge of rust-lang#134214 - klensy:rd-shadow, r=notriddle

rustdoc: fix self cmp

Looks like condition in `filter` currently always `true`, but intended to compare with `fqp` from `if let Some(&(ref fqp, item_type))`?
@bors bors merged commit 357d03d into rust-lang:master Dec 12, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants