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

Issue a warning when a file is included twice #10569

Closed
alexcrichton opened this issue Nov 19, 2013 · 2 comments
Closed

Issue a warning when a file is included twice #10569

alexcrichton opened this issue Nov 19, 2013 · 2 comments
Labels
A-parser Area: The parsing of Rust source code to an AST

Comments

@alexcrichton
Copy link
Member

It's a common mistake to have code like:

mod foo;
mod bar {
  mod foo;
}

Many newcomers expect this to have two instances of the same module foo. This in fact declares two separate foo modules which have different types (even though they have the same contents).

We should print a suppressable warning about when this happens. Something along the lines of second inclusion of foo.rs, did you mean to "use" the module instead?

@dcrewi
Copy link
Contributor

dcrewi commented Nov 19, 2013

This is issue #5765 and I had started to write a patch for it. I suppose I can fix it up.

@alexcrichton
Copy link
Member Author

Ah yes, dupe of #5765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

2 participants