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

Plumbing for local items support #2600

Merged
merged 3 commits into from
Dec 19, 2019
Merged

Conversation

matklad
Copy link
Member

@matklad matklad commented Dec 19, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 19, 2019
2600: Plumbing for local items support r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 19, 2019

Build succeeded

  • Rust
  • TypeScript

@bors bors bot merged commit 9ccad60 into rust-lang:master Dec 19, 2019
@ice1000
Copy link
Contributor

ice1000 commented Dec 19, 2019

🎉🤖🚀❤️💟😍

@matklad matklad deleted the defs-in-bodies branch December 19, 2019 19:51
@ice1000
Copy link
Contributor

ice1000 commented Dec 19, 2019

What's the next step of supporting local imports?

@flodiebold
Copy link
Member

How do you intend to handle something like

fn foo() {
    {
        fn bar() {}
    }
}

? Should the container just be the function here, even though it's actually a nested scope?

@matklad
Copy link
Member Author

matklad commented Dec 19, 2019

@ice1000 local imports will be supported last, as they are the most complex bit.

@flodiebold don't know yet! My current plan is to treat every item as if declared in the outermost block, which will cover 80% of use-cases I hope!

I think though we do want to anchor every item at the def, for identification purposes. That is, the name resolution scopes don't have to correspond 1-to-1 to how we store things internally.

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.

3 participants