Closed
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.