So there're three "shape"s for a module: 1. single mode: file.rs 2. headless mode: file/ mod.rs + <submodules> 3. 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 it is its sibling modules, not submodules.