Skip to content

Disallow 'import foo;' #1792

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
marijnh opened this issue Feb 9, 2012 · 2 comments
Closed

Disallow 'import foo;' #1792

marijnh opened this issue Feb 9, 2012 · 2 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@marijnh
Copy link
Contributor

marijnh commented Feb 9, 2012

It seems that it doesn't actually do anything (you're making foo in the current scope refer to ... whatever foo refers to in the current scope).

Or am I missing something?

@catamorphism
Copy link
Contributor

@marijnh -- can you clarify what you want to disallow? You want to forbid importing anything that's just a single identifier (as opposed to a path with more than one element in it), right? Which seems quite reasonable if so.

@marijnh
Copy link
Contributor Author

marijnh commented Apr 16, 2012

Yes, I was talking about single-identifier imports.

Interestingly, with impl scoping rules, such a thing might actually have an effect (when importing an impl, it moves it into the current block, and thus gives it higher precedence), so I guess there's no reason to disallow it.

I'm going to close this.

@marijnh marijnh closed this as completed Apr 16, 2012
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants