-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
Description
Sometimes people use multiple mod
statements that refer to the same file in order to access that files content as a module in different modules/files, thinking all those instances would be identical. But in reality that just duplicates all definitions in the file at different places in the module hierarchy, which leads to confusing errors like two presumably identical types not being identical etc.
I think two mod
statements in a crate that refer to the same file should at least emit a code duplication warning, if not an error, because it's almost never what you want.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically