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

Allow importing from the current scope #1326

Closed
wthrowe opened this issue Oct 16, 2015 · 2 comments
Closed

Allow importing from the current scope #1326

wthrowe opened this issue Oct 16, 2015 · 2 comments

Comments

@wthrowe
Copy link

wthrowe commented Oct 16, 2015

One of the big arguments in favor of RFC #390 (enum namespacing) was that it was easy to get the old behavior back using an import. There is one case, however, where this is not possible: an enum defined in an unnameable scope. I think the only place in current Rust where one can do this is inside a function.

mod a {
    fn b() {
        enum Foo { Bar }
        use Foo::Bar; // Tries to find to Foo in the crate scope (or as an external crate).
        use self::Foo::Bar; // Tries to find a::Foo.
    }
}

I haven't come up with a good syntax to propose for this operation, though.

@wthrowe
Copy link
Author

wthrowe commented Oct 16, 2015

And for completely unrelated reasons I just happened to stumble upon the related rust-lang/rust#23314.

@wthrowe
Copy link
Author

wthrowe commented Oct 29, 2015

Duplicate of #959.

@wthrowe wthrowe closed this as completed Oct 29, 2015
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

No branches or pull requests

1 participant