Skip to content

Option to disable workspace edit feature of cargo new #13432

@bjorn3

Description

@bjorn3

Problem

cargo new will unconditionally add the new crate to a cargo workspace when there is a Cargo.toml in the parent directory, even when that Cargo.toml is not intended as cargo workspace. For example I might create a new crate just to quickly test something or the build system can't handle the parent Cargo.toml being a cargo workspace for whatever reason.

Proposed Solution

Add an option to cargo new to stop it from adding the new crate to any cargo workspace. And maybe disable the auto adding when there isn't yet a cargo workspace.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-newS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions