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

Forbid modules from having the same name as any of their ancestors #11037

Closed
bstrie opened this issue Dec 17, 2013 · 4 comments
Closed

Forbid modules from having the same name as any of their ancestors #11037

bstrie opened this issue Dec 17, 2013 · 4 comments

Comments

@bstrie
Copy link
Contributor

bstrie commented Dec 17, 2013

Our name resolution rules are already impossible to understand, and this just makes things worse, especially with the opaque crate-relative-imports rule. This change would make a module named foo::foo illegal.

@bvssvni
Copy link

bvssvni commented Dec 17, 2013

A warning when a mod 'foo' declared in 'foo.rs' or a hint in the 'unresolved name' error message could be enough.

@alexcrichton
Copy link
Member

This seems like the wrong solution for a real problem to me. If our name resolution rules are difficult to understand, then that means we need more thorough documentation. I was under the impression that this was all well documented now, but I could very well be wrong! What rules are you referring to when you say that they're impossible to understand? These are real bugs that we need to get fixed before 1.0.

A rule like this I feel is way too much of a special case for a common bug when as @bvssvni pointed out a warning would suffice just as well.

@alexcrichton
Copy link
Member

@bstrie, are you comfortable closing this in favor of rust-lang/rfcs#63 ?

@bstrie
Copy link
Contributor Author

bstrie commented May 13, 2014

It's certainly a step in the same direction. I'm not sure it supplants this entirely, but now that we have a real RFC process I'm going to close this issue anyway.

@bstrie bstrie closed this as completed May 13, 2014
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

3 participants