So there're three "shape"s for a module:
a. single mode: file.rs
b. headless mode: file/mod.rs + \<submodules\>
c. file.rs + file/ \<submodules\>.
The path
attribute supports the traditional two modes(1st+2nd mode). When you specify a file using path
, it acts as if that file is the mod.rs
, and assumes its submodules live by the side of it. However if your project is using 2018 edition recommended mode (1st+3rd mode), that will become a mess, as the files living by the side is intended to be its sibling modules, not submodules.
The rust issue corresponding to this is https://github.com/rust-lang/rust/issues/59345 .
My personal suggestion is that maybe allow adding a little more information within the path attribute to denote that behavior c is intended