Skip to content

add block kind during name resolution #145058

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

Closed
wants to merge 1 commit into from
Closed

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Aug 7, 2025

cc #143141 (comment)

I've discovered we cannot completely remove RibKind::Module as it's still required for module scope operations and is more semantically appropriate, such as:

fn with_mod_rib<T>(&mut self, id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T {
let module = self.r.expect_module(self.r.local_def_id(id).to_def_id());
// Move down in the graph.
let orig_module = replace(&mut self.parent_scope.module, module);
self.with_rib(ValueNS, RibKind::Module(module), |this| {
this.with_rib(TypeNS, RibKind::Module(module), |this| {
let ret = f(this);
this.parent_scope.module = orig_module;
ret
})
})
}

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 7, 2025
@petrochenkov
Copy link
Contributor

Ha, I assumed it's already night at your time zone so I started working on this myself.
Let me finish the work, I also want to fix some pre-existing bugs when Normal and Module for blocks weren't treated in the same way.

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Aug 7, 2025

Got it, closing it.

@bvanjoi bvanjoi closed this Aug 7, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants