Skip to content

Add a compiler option for a 'pseudo-cwd' for rustc errors #47939

Closed
@alexcrichton

Description

@alexcrichton

Cargo's behavior of what the cwd is when rustc is invoked changed in rust-lang/cargo#4788 for a number of reasons, but this has caused a number of regressions in tooling because the paths printed in error messages are now relative to a different location.

In talking with @nikomatsakis an idea that came up was that we could add an option to the compiler to say "print diagnostic paths relative to this location". Cargo could pass the current cwd of the cargo process itself when invoking rustc and the compiler would otherwise know to not encode this value into the output artifact at all.

cc @estebank, you may be interested in this as well!

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsP-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions