-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Comments
A warning when a mod 'foo' declared in 'foo.rs' or a hint in the 'unresolved name' error message could be enough. |
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. |
@bstrie, are you comfortable closing this in favor of rust-lang/rfcs#63 ? |
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. |
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.The text was updated successfully, but these errors were encountered: