Error messages use relative paths differently if in a workspace #5895
Labels
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Error messages printed by
rustc
are relative to the path printed bycargo
only when the crate is not part of a workspace. When the crate is a workspace member,rustc
's messages are relative to the workspace directory. This makes it hard for programs like Emacs to find the file to which the error messages apply.Here's the non-workspace case:
The path in the
rustc
error message,src/main.rs
, is relative to the path given in theChecking...
message,/home/jimb/play/str2
.But if we create a workspace, things are different:
In this case,
rustc
's error message citesmember/src/main.rs
, whilecargo
's output cites/home/jimb/play/str/member
.This behavior is consistent regardless of the directory in which one invokes
cargo check
,cargo build
, or whatever.See also
The text was updated successfully, but these errors were encountered: