Problem
When using --manifest-path, the filenames in error messages are relative to the manifest given, not the directory cargo is invoked from.
Steps
- For example in Miri, introduce a build failure in
cargo-miri/src/main.rs.
- Run
cargo check --manifest-path cargo-miri/Cargo.toml
- Notice the error refers to
src/main.rs:21:17
Possible Solution(s)
Cargo could instruct rustc to print the paths relative to a given directory, or it could adjust the paths itself.
Notes
This also affects the rustc repo, where we have 3 workspaces currently (the main one, bootstrap, and codegen_cranelift). Errors in codegen_cranelift show paths that are quite hard to interpret since they are relative to src/compiler/rustc_codegen_cranelift, which is hard to users to even realize.
Version
No response