rust/compiler/rustc_span/src
bors 97f2698484 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`
2021-09-03 00:23:10 +00:00
..
analyze_source_file remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
lev_distance Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
source_map Split span_to_string into span_to_diagnostic/embeddable_string 2021-05-11 00:04:12 +01:00
symbol Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
analyze_source_file.rs Fix some clippy lints 2020-12-03 17:08:19 -05:00
caching_source_map_view.rs rustc_span: add span_data_to_lines_and_cols to caching source map view 2020-12-03 18:36:34 -08:00
def_id.rs Encode ExpnId using ExpnHash for incr. comp. 2021-07-17 19:41:08 +02:00
edition.rs Update LATEST_STABLE_EDITION to 2021. 2021-08-30 15:33:09 +02:00
fatal_error.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
hygiene.rs Lower let-else to HIR 2021-08-30 20:17:46 -05:00
lev_distance.rs Edit rustc_span documentation 2020-12-25 14:02:52 -08:00
lib.rs Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank 2021-09-03 00:23:10 +00:00
source_map.rs Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank 2021-09-03 00:23:10 +00:00
span_encoding.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
symbol.rs Rollup merge of #88350 - programmerjake:add-ppc-cr-xer-clobbers, r=Amanieu 2021-09-01 09:23:26 +02:00
tests.rs Inline implementation of lookup_line 2021-07-08 23:30:53 +02:00