`#[path]` causes issues for beginners

I'm curious how beginners even learn about advanced things like #[path]. It isn't mentioned or documented in most books that I've seen. I skimmed through some of the answers on SO and the top results on Google and don't see it mentioned anywhere.

CAD97's recommendation of a lint for duplicate mods from the same file sounds like a good idea. It looks like the duplicate_mod lint in clippy does exactly that? Perhaps it would be worthwhile to check how reliable that lint is, and if it is reliable, perhaps add it to rustc?

4 Likes