--remap-path-prefix no longer works for compiler messages · Issue #87745 · rust-lang/rust (original) (raw)

Code

Create a directory and put a Rust file with bad syntax in it:

mkdir src
echo bad > src/test.rs

Then compile it with:

rustc --remap-path-prefix=src=MODIFIED src/test.rs

I expected to see output like this:

error: expected one of `!` or `::`, found `<eof>`
 --> MODIFIED/test.rs:1:1
[snip]

Instead, the path is not modified and I get:

error: expected one of `!` or `::`, found `<eof>`
 --> src/test.rs:1:1
[snip]

Version it worked on

rustc 1.53.0 (53cb7b0 2021-06-17)

Version with regression

rustc 1.54.0 (a178d03 2021-07-26)