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

Fix: Handle block exprs as modules when finding their parents #18206

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

ShoyuVanilla
Copy link
Member

Fixes #18187

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 29, 2024
container
.unwrap_or(*def)
.module(db)
.map(|module| path(db, module, definition_owner_name(db, def, edition), edition))
Copy link
Member Author

@ShoyuVanilla ShoyuVanilla Sep 29, 2024

Choose a reason for hiding this comment

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

We currently have another bug like in;
image
So, check for the path of the assoc item container instead of def iteslf whenever def is an assoc item

.filter(|m| !matches!(m.definition_source(db).value, ModuleSource::BlockExpr(_)))
.count()
// exclude `m` itself
.saturating_sub(1);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit awkward but we need to substract one when m itself is a block expr module

@bors
Copy link
Collaborator

bors commented Sep 29, 2024

☔ The latest upstream changes (presumably #18205) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril
Copy link
Member

Veykril commented Sep 30, 2024

@bors delegate+

@bors
Copy link
Collaborator

bors commented Sep 30, 2024

✌️ @ShoyuVanilla, you can now approve this pull request!

If @Veykril told you to "r=me" after making some further change, please make that change, then do @bors r=@Veykril

@ShoyuVanilla
Copy link
Member Author

@bors r=@Veykril

@bors
Copy link
Collaborator

bors commented Oct 1, 2024

📌 Commit e09c2a0 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 1, 2024

⌛ Testing commit e09c2a0 with merge 417ee6f...

@bors
Copy link
Collaborator

bors commented Oct 1, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 417ee6f to master...

@bors bors merged commit 417ee6f into rust-lang:master Oct 1, 2024
11 checks passed
@ShoyuVanilla ShoyuVanilla deleted the issue-18187 branch October 1, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover path does not correctly account for block scopes
4 participants