Skip to content

Conversation

sagudev
Copy link
Contributor

@sagudev sagudev commented Jan 7, 2025

The way ribs were presented before one would assume helper would be available inside closure, but it's not:

let helper = || {
        helper(); // helper not found in this scope
};

that's because ribs for let are introduced at the end of let statement and not while in expresions.

related zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Ribs.20in.20name.20resolution

It is possible that my understanding is wrong, so please correct me if I am wrong.

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

This seems reasonable, but it'd be good to get a review from someone more experienced with the resolver. cc @petrochenkov maybe? (feel free to "reassign" of course)

@jieyouxu jieyouxu added S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content A-resolve Area: name resolution T-compiler Relevant to compiler team labels Jan 10, 2025
@jieyouxu
Copy link
Member

Ping @petrochenkov, if you have time, could you kindly double-check?

@petrochenkov petrochenkov self-assigned this Mar 20, 2025
@petrochenkov petrochenkov merged commit c95537b into rust-lang:master Mar 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: name resolution S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content T-compiler Relevant to compiler team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants