-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
#3004 broken it a bit.
Previously Cargo looked for files like main.rs, src/main.rs, lib.rs, src/lib.rs, projectname.rs and src/projectname.rs and created [[bin]] and/or [lib] sections in Cargo.toml automatically if source files located unusually.
Now it does look for those files, but fails to use this information meaningfully and just creates src/main.rs or src/lib.rs instead of using sections in Cargo.toml even if a usable source file outside src already exists, making the "hello world" lib or app while previously it used pre-existing source code.
What shall be done? Options:
- Remove any auto-detection code. Rely only on explicit
--lib/--bin. Don't look at any files except ofsrc/{main,lib}.rs - Implement insertion of
[[bin]]and[lib]again (when--templateis not in use) - Make Cargo move pre-existing source file to the appropriate location in
cargo init, e.gmyapp/myapp.rsbecomesmyapp/src/main.rs.
Metadata
Metadata
Assignees
Labels
No labels