Skip to content

fix: issue 22826 - #23256

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
j-ricardo-goncalves:master
Aug 30, 2026
Merged

ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
j-ricardo-goncalves:master

Conversation

@j-ricardo-goncalves

@j-ricardo-goncalves j-ricardo-goncalves commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

fixes issue by using a different approach on parent_len in crate/hir/src/lib.rs
added coverage test

seems to solve the issue while doing the least possible changes

Fixes #22826.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2026
@j-ricardo-goncalves

Copy link
Copy Markdown
Contributor Author

#22826

Comment thread crates/ide/src/hover/tests.rs
Comment thread crates/hir/src/lib.rs Outdated
_ => None,
})
.map(|container| GenericParams::of(db, container).len())
.unwrap_or(0);

@ChayimFriedman2 ChayimFriedman2 Aug 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not good enough because of late-bound lifetimes.

I think the best solution is to avoid computing the parent length at all, instead directly chain

self.subst.types().zip(container_type_params.into_iter().flatten().chain(type_params)).filter_map(|(ty, name)| {
                Some((
                    name?.symbol().clone(),
                    Type { ty: EarlyBinder::bind(ty), owner: self.owner },
                ))
            })

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.

did a similar approach in the new commit

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rustbot

This comment has been minimized.

@j-ricardo-goncalves

Copy link
Copy Markdown
Contributor Author

squashed

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master 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.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 30, 2026
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits labels Aug 30, 2026
@j-ricardo-goncalves

Copy link
Copy Markdown
Contributor Author

I think its done now, tried to clean up the git thing.

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ChayimFriedman2
ChayimFriedman2 added this pull request to the merge queue Aug 30, 2026
Merged via the queue into rust-lang:master with commit f899669 Aug 30, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic shown on hover is incorrect when there is a impl Trait in the inputs and a const generic

3 participants