Curly brace support for mod

There used to be recurring questions about mod vs use in the user forum, until I've added a note to the error message:

help: to create the module foo, create file "src/foo.rs" or "src/foo/mod.rs"
note: if there is a mod foo elsewhere in the crate already, import it with use crate::... instead

and I think it largely solved the problem. This message could have been better if it could suggest actual use path, but unfortunately it's quite tricky, because when the mod items are parsed, the crate's module structure doesn't exist yet.

9 Likes