Skip to content

Include location of workspace manifest in error loading workspace #13394

Closed
@fawq

Description

@fawq

Problem

I've tried to create new project inside project which was previously created by cargo init and removed. Now when I want to create new project inside, I've got an error that there is a missing Cargo.toml in parent directory, but parent directory doesn't need to have Cargo.toml because it should be simple directory contains all rust projects.

Steps:

  1. Create directory e.g. "/home/ubuntu/Projects/Rust/"
  2. Go inside this directory and type cargo init
  3. Change mind and remove all files rm -r *
  4. Create new project inside this directory e.g. cargo new test_rust_wsl
  5. New directory is created "/home/ubuntu/Projects/Rust/test_rust_wsl"
  6. Go inside new directory and try build cargo build

Get the error:

error: failed to load manifest for workspace member /home/ubuntu/Projects/Rust

Caused by:
failed to read /home/ubuntu/Projects/Rust/Cargo.toml

Caused by:
No such file or directory (os error 2)

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.75.0 (1d8b05cdd 2023-11-20)
release: 1.75.0
commit-hash: 1d8b05cdd1287c64467306cf3ca2c8ac60c11eb0
commit-date: 2023-11-20
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-bugCategory: bugS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions