You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cargo new --bin x
cd x
touch src/a.rs
echo'mod a;'>> src/main.rs
echo'mod main;'>> src/main.rs
cargo build
Results in this error message:
src/main.rs:4:5: 4:6 error: cannot declare a new module at this location
src/main.rs:4 mod a;
^
src/main.rs:4:5: 4:6 note: maybe move this module `main` to its own directory via `main/mod.rs`
src/main.rs:4 mod a;
^
src/main.rs:4:5: 4:6 note: ... or maybe `use` the module `a` instead of possibly redeclaring it
src/main.rs:4 mod a;
^
None of which indicates that main.rs is being included recursively. Removing the mod main; line builds succesfully.
The text was updated successfully, but these errors were encountered:
Executing the following:
Results in this error message:
None of which indicates that
main.rs
is being included recursively. Removing themod main;
line builds succesfully.The text was updated successfully, but these errors were encountered: