]> git.lizzy.rs Git - rust.git/commit
Warn when creating a module and a struct that both have the same name.
authorNick Hamann <nick@wabbo.org>
Thu, 22 Oct 2015 19:53:01 +0000 (14:53 -0500)
committerNick Hamann <nick@wabbo.org>
Thu, 22 Oct 2015 22:12:16 +0000 (17:12 -0500)
commitf0af1eb110b3dd12754b02bc3dcb7127ea2dce7f
tree55c04afff812ba379cdc9fbc69236cd6a9ef1691
parent5692e16270ad844e89aa56859d5f8311159e2eea
Warn when creating a module and a struct that both have the same name.

Currently it is possible to do the following:

 - define a module named `Foo` and then a unit or tuple struct also named `Foo`
 - define any struct named `Foo` and then a module named `Foo`

This commit introduces a warning for both of these cases.
src/librustc_resolve/build_reduced_graph.rs
src/test/compile-fail/issue-21546.rs [new file with mode: 0644]
src/test/run-pass/issue-14564.rs [deleted file]