Can I move Cargo.toml

I've moved contents of directory(including Cargo.toml) created by cargo new to another directory.

Now cargo build is still trying to see Cargo.toml in old directory (which doesn't have a Cargo.toml anymore)

Am I missing anything. Is moving not allowed?

Ok. This seems to be a problem with the name of target folder. Old folder name was mosquitto while new folder name is rust-mosquitto.

Cargo usually removes rust- while creating new crates. This seems to be the case even with existing folders

Not sure if this is a bug or a design decision.

Have you moved Cargo.lock too?

Also, did you try cargo clean?

1 Like