Email me

Rust errors / Build and Cargo

Rust build error · checked with Rust 1.99.0

error: current package believes it's in a workspace when it's not

error: current package believes it's in a workspace when it's not

What it meansA Cargo.toml in a parent folder declares a [workspace], but this package is not listed in its members (or is not excluded).

Why it happens

  • A new crate created inside a workspace folder.
  • A stray Cargo.toml higher up (for example in your home directory).

How to fix it

1. Add it to the workspace

In the parent Cargo.toml.

[workspace]
members = ["crates/*", "my-new-crate"]

2. Or exclude it

[workspace]
exclude = ["my-new-crate"]

3. Or make it its own workspace

In the package's Cargo.toml.

[workspace]

Other wordings of this error

current package believes it's in a workspace when it's not, believes its in a workspace

Other build errors

Up next

Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ