]> git.lizzy.rs Git - rust.git/commit
Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank
authorbors <bors@rust-lang.org>
Fri, 3 Sep 2021 00:23:10 +0000 (00:23 +0000)
committerbors <bors@rust-lang.org>
Fri, 3 Sep 2021 00:23:10 +0000 (00:23 +0000)
commita0152da5ae5acc68706bc842204a8869ffac0f6d
treef69a748880f08f6096bfca69e1593d57de6b159c
parent78bf4acc3a18848e21896bae97859c5811b320d4
parentc6c1f328ebedabbe1779a9a0543b9f6ba2696e8a
Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank

Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.

This PR fixes a regression (#87745) with `--remap-path-prefix` where the flag stopped causing diagnostic messages to be remapped as well. The regression was introduced in https://github.com/rust-lang/rust/pull/83813 where we erroneously assumed that remapping of diagnostic messages was not desired anymore (because #70642 partially undid that functionality with nobody objecting).

The issue is fixed by making `--remap-path-prefix` remap diagnostic messages again, including for paths that have been remapped in upstream crates (e.g. the standard library). This means that "sysroot-localization" (implemented in #70642) is also disabled if `rustc` is invoked with `--remap-path-prefix`. The assumption is that once someone starts explicitly remapping paths they also don't want paths to their local Rust installation in their build output.

In the future we might want to give more fine-grained control over this behavior via compiler flags (see https://github.com/rust-lang/rfcs/pull/3127 for a related RFC). For now this PR is intended as a regression fix.

This PR is an alternative to https://github.com/rust-lang/rust/pull/88191, which makes diagnostic messages be remapped unconditionally. That approach, however, would effectively revert #70642.

Fixes https://github.com/rust-lang/rust/issues/87745.

cc `@cbeuw`
r? `@ghost`