Skip to content

Refactor out common code into a IndexItem::new constructor#149452

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
yotamofek:pr/rustdoc/IndexItem-new
Apr 24, 2026
Merged

Refactor out common code into a IndexItem::new constructor#149452
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
yotamofek:pr/rustdoc/IndexItem-new

Conversation

@yotamofek
Copy link
Copy Markdown
Contributor

@yotamofek yotamofek commented Nov 29, 2025

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 Nov 29, 2025
@yotamofek
Copy link
Copy Markdown
Contributor Author

yotamofek commented Nov 29, 2025

@lolbinarycat Felt like doing something semi-mechanical that doesn't require too much concentration, so thought I'd tackle the issue you opened.

But TBH, after pulling out the common code into an IndexItem constructor, I'm not sure it makes much sense and/or is worth it.
What do you think?

@rust-log-analyzer

This comment has been minimized.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch 2 times, most recently from 32d0484 to 6cedf2c Compare November 29, 2025 17:13
Comment thread src/librustdoc/html/render/mod.rs
@rust-log-analyzer

This comment has been minimized.

@lolbinarycat
Copy link
Copy Markdown
Contributor

It was working on #149460 that inspired this issue, and I agree that perhaps a substruct would be a better approach.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from 6cedf2c to acd4d7e Compare December 12, 2025 22:32
@yotamofek
Copy link
Copy Markdown
Contributor Author

What do you think about how it looks now? @lolbinarycat
(still need to find a better name for the "sub struct")

@yotamofek
Copy link
Copy Markdown
Contributor Author

the amount of times I typed "sub stract" instead of "sub struct"....... 😤

@lolbinarycat
Copy link
Copy Markdown
Contributor

IndexItemInfo maybe? then the field could just be named info

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from a39f59d to 86a2e85 Compare December 15, 2025 20:26
@yotamofek yotamofek marked this pull request as ready for review December 15, 2025 20:27
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 15, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 15, 2025
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Dec 15, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
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

@yotamofek
Copy link
Copy Markdown
Contributor Author

Well, done, not sure it's an improvement, but let's see what others think.

@GuillaumeGomez
Copy link
Copy Markdown
Member

Changes look good to me. So if it's ok with lolbinarycat and notriddle, you can r=us.

@rust-bors

This comment has been minimized.

@lolbinarycat
Copy link
Copy Markdown
Contributor

Will need to be rebased on top of #149460 once that is merged.

@Enselic
Copy link
Copy Markdown
Member

Enselic commented Apr 17, 2026

Triage: This seems close to having been merged. @lolbinarycat @notriddle Are you OK with r=GuillaumeGomez
after this has been rebased?

@lolbinarycat
Copy link
Copy Markdown
Contributor

I would like to actually see the rebased code, as I believe it would not be entirely trivial, but I am still on board with this change.

@notriddle
Copy link
Copy Markdown
Contributor

@lolbinarycat I agree. This looks like a good change, overall, and just needs rebased.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from 86a2e85 to 0cb2e2f Compare April 18, 2026 19:23
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 18, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@yotamofek
Copy link
Copy Markdown
Contributor Author

Here we go!
Not sure how much sense this makes after rebase, but I've lost context in the couple of months since I touched this PR, so leaving the call to fresh-er eyes.

(also, wasn't really around for the past two months or so, so - hey everyone :))

@rust-log-analyzer

This comment has been minimized.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from 0cb2e2f to a6c2f86 Compare April 19, 2026 06:56
Comment thread src/librustdoc/formats/cache.rs Outdated
let is_deprecated = item.is_deprecated(tcx);
let is_unstable = item.is_unstable();
let index_item = IndexItem {
ty: item.type_(),
Copy link
Copy Markdown
Contributor

@notriddle notriddle Apr 19, 2026

Choose a reason for hiding this comment

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

Why isn't ty: item.type_() a member of IndexItemInfo. It's common code shared between both spots where IndexItem is constructed, but it isn't factored out.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Missed that, thanks!

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from a6c2f86 to ab1500b Compare April 22, 2026 20:49
@notriddle
Copy link
Copy Markdown
Contributor

@bors r=notriddle,lolbinarycat

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

📌 Commit ab1500b has been approved by notriddle,lolbinarycat

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149452 (Refactor out common code into a `IndexItem::new` constructor)
 - #155621 (Document #[diagnostic::on_move] in the unstable book.)
 - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations)
 - #155730 (Some cleanups around per parent disambiguators)
 - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu)
 - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations)
 - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer)
 - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf)
 - #155713 (test: Add a regression test for Apple platforms aborting on `free`)
 - #155723 (Fix tier level for 5 thumb bare-metal ARM targets)
 - #155735 (Fix typo by removing extra 'to')
 - #155736 (Remove `AllVariants` workaround for rust-analyzer)
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

⌛ Testing commit ab1500b with merge 1790f3a...

Workflow: https://github.com/rust-lang/rust/actions/runs/24902498468

rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
…le,lolbinarycat

Refactor out common code into a `IndexItem::new` constructor




#149404
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #155745.

rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149452 (Refactor out common code into a `IndexItem::new` constructor)
 - #155621 (Document #[diagnostic::on_move] in the unstable book.)
 - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations)
 - #155730 (Some cleanups around per parent disambiguators)
 - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu)
 - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations)
 - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer)
 - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf)
 - #155713 (test: Add a regression test for Apple platforms aborting on `free`)
 - #155723 (Fix tier level for 5 thumb bare-metal ARM targets)
 - #155735 (Fix typo by removing extra 'to')
 - #155736 (Remove `AllVariants` workaround for rust-analyzer)
@rust-bors rust-bors Bot merged commit d4a700a into rust-lang:main Apr 24, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 24, 2026
rust-timer added a commit that referenced this pull request Apr 24, 2026
Rollup merge of #149452 - yotamofek:pr/rustdoc/IndexItem-new, r=notriddle,lolbinarycat

Refactor out common code into a `IndexItem::new` constructor

#149404
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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants