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 rib example #2199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix rib example #2199

wants to merge 1 commit into from

Conversation

sagudev
Copy link

@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
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.

3 participants