diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index df4d814fb11a..a3d08bb4db04 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -802,7 +802,7 @@ fn mk(gctx: &GlobalContext, opts: &MkOptions<'_>) -> CargoResult<()> { } } - let manifest_path = path.join("Cargo.toml"); + let manifest_path = paths::normalize_path(&path.join("Cargo.toml")); if let Ok(root_manifest_path) = find_root_manifest_for_wd(&manifest_path) { let root_manifest = paths::read(&root_manifest_path)?; // Sometimes the root manifest is not a valid manifest, so we only try to parse it if it is. diff --git a/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/workspace/Cargo.toml b/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/workspace/Cargo.toml index ce2c1898ce13..cd7525f40507 100644 --- a/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/workspace/Cargo.toml +++ b/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/workspace/Cargo.toml @@ -1,5 +1,4 @@ [workspace] -members = ["../out-of-workspace"] [package] name = "foo" diff --git a/tests/testsuite/cargo_new/ignore_current_dir_workspace/stderr.term.svg b/tests/testsuite/cargo_new/ignore_current_dir_workspace/stderr.term.svg index a7b5660b5f07..7858e42a578b 100644 --- a/tests/testsuite/cargo_new/ignore_current_dir_workspace/stderr.term.svg +++ b/tests/testsuite/cargo_new/ignore_current_dir_workspace/stderr.term.svg @@ -1,10 +1,9 @@ - +