Problem
When running cargo run --manifest-path foo.rs, cargo prints the following:
error: the manifest-path must be a path to a Cargo.toml file: `/Users/eric/Temp/z10/foo.rs`
This is a little confusing because --manifest-path can point to either a Cargo.toml or an embedded script file.
Steps
cargo run --manifest-path foo.rs
Possible Solution(s)
The error could say something like:
error: the manifest-path must be a path to a Cargo.toml file or a script file: `{path}`
Notes
No response
Version
cargo 1.95.0-nightly (fe2f314ae 2026-01-30)
release: 1.95.0-nightly
commit-hash: fe2f314aef06e688a9517da1ac0577bb1854d01f
commit-date: 2026-01-30
host: aarch64-apple-darwin
libgit2: 1.9.2 (sys:0.20.3 vendored)
libcurl: 8.7.1 (sys:0.4.83+curl-8.15.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Mac OS 26.2.0 [64-bit]
Problem
When running
cargo run --manifest-path foo.rs, cargo prints the following:This is a little confusing because
--manifest-pathcan point to either aCargo.tomlor an embedded script file.Steps
cargo run --manifest-path foo.rsPossible Solution(s)
The error could say something like:
Notes
No response
Version