]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
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)
commit97f2698484c2d668b2f356a6c2252e5f08472234
tree209632109616122d110c477a33d4f13b0f623e15
parent371f3cd3fe523d0b398ed1db1620667c53ba7d02
parentc296c89be601a57597a1c262b9e3a4c9b4d056cf
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`
compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_mir/src/interpret/eval_context.rs
compiler/rustc_span/src/lib.rs
compiler/rustc_span/src/source_map.rs