tests/common/submod.rs
would be bad, yes. But Rust isn't forcing you to do that. You can do what I suggested: make tests/common_tests.rs
, which can say mod common;
to import tests/common/mod.rs
. (That way, neither file is named tests/common.rs
). This is a better naming convention, because the tests and the submodule are different things, so they should have different names.
If there's a situation where Rust is forcing bad naming conventions in some way, what we should do is to come up with a feature that would allow good naming conventions instead. The proposal in this thread would allow different naming conventions, but they are not good – only bad in a different way.