rust/src/tools
bors e1ff91f439 Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister
Fix `--remap-path-prefix` not correctly remapping `rust-src` component paths and unify handling of path mapping with virtualized paths

This PR fixes #73167 ("Binaries end up containing path to the rust-src component despite `--remap-path-prefix`") by preventing real local filesystem paths from reaching compilation output if the path is supposed to be remapped.

`RealFileName::Named` introduced in #72767 is now renamed as `LocalPath`, because this variant wraps a (most likely) valid local filesystem path.

`RealFileName::Devirtualized` is renamed as `Remapped` to be used for remapped path from a real path via `--remap-path-prefix` argument, as well as real path inferred from a virtualized (during compiler bootstrapping) `/rustc/...` path. The `local_path` field is now an `Option<PathBuf>`, as it will be set to `None` before serialisation, so it never reaches any build output. Attempting to serialise a non-`None` `local_path` will cause an assertion faliure.

When a path is remapped, a `RealFileName::Remapped` variant is created. The original path is preserved in `local_path` field and the remapped path is saved in `virtual_name` field. Previously, the `local_path` is directly modified which goes against its purpose of "suitable for reading from the file system on the local host".

`rustc_span::SourceFile`'s fields `unmapped_path` (introduced by #44940) and `name_was_remapped` (introduced by #41508 when `--remap-path-prefix` feature originally added) are removed, as these two pieces of information can be inferred from the `name` field: if it's anything other than a `FileName::Real(_)`, or if it is a `FileName::Real(RealFileName::LocalPath(_))`, then clearly `name_was_remapped` would've been false and `unmapped_path` would've been `None`. If it is a `FileName::Real(RealFileName::Remapped{local_path, virtual_name})`, then `name_was_remapped` would've been true and `unmapped_path` would've been `Some(local_path)`.

cc `@eddyb` who implemented `/rustc/...` path devirtualisation
2021-05-12 11:05:56 +00:00
..
build-manifest Remove the x86_64-rumprun-netbsd target 2021-02-27 17:55:22 +02:00
cargo@070e459c2d Update cargo 2021-05-11 17:39:51 -07:00
cargotest Add support for --test-args to cargotest 2021-05-01 01:13:53 -04:00
clippy Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister 2021-05-12 11:05:56 +00:00
compiletest Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister 2021-05-12 11:05:56 +00:00
error_index_generator mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
expand-yaml-anchors Tell user how to fix CI file being not up to date 2021-02-11 19:57:59 -05:00
jsondocck Better errors in jsondocck 2021-03-24 16:54:12 +00:00
linkchecker Bump cfgs 2021-04-04 14:57:05 -04:00
lint-docs Add 2021 compatibility lint description 2021-04-26 15:08:55 +02:00
miri@38b5f236d2 Update Miri 2021-05-08 19:53:15 +08:00
remote-test-client Update armhf-gnu to Ubuntu 20.04 2021-01-30 00:33:02 +01:00
remote-test-server Preserve existing LD_LIBRARY_PATH in remote-test-server 2021-01-27 23:08:15 +00:00
rls@e33f4e6849 Update RLS 2021-05-08 01:10:51 +02:00
rust-analyzer@fd109fb587 ⬆️ rust-analyzer 2021-05-10 15:11:01 +03:00
rust-demangler Address review comments and Windows failure, and make cleaner 2021-04-03 18:03:50 -07:00
rust-installer@5254dbfd25 bump rust-installer submodule 2020-12-28 12:48:11 +01:00
rustbook Update mdbook 2021-01-14 17:50:23 -08:00
rustc-workspace-hack Lock down rand_core 0.5.1 to specific features 2021-04-23 18:00:46 -07:00
rustdoc use jemallocator in rustc/rustdoc 2021-04-04 14:10:26 -07:00
rustdoc-gui Don't stop running rustdoc-gui tests at first failure 2021-05-07 16:51:00 +02:00
rustdoc-js Updated tester.js for separate search.js 2021-04-13 16:43:14 -07:00
rustdoc-themes Format the world 2019-12-22 17:42:47 -05:00
rustfmt@2a3635d5d1 Update RLS and Rustfmt 2021-05-05 12:36:21 +02:00
tidy fix tidy 2021-05-11 22:25:10 +03:00
tier-check Remove note about missing ios/tvos targets in platform docs. 2020-09-25 12:09:06 -07:00
unicode-table-generator unicode_table_generator: fix clippy::writeln_empty_string, clippy::useless_format, clippy:::for_kv_map 2020-08-24 00:43:50 +02:00
unstable-book-gen Replace write_fmt with write! 2020-09-20 10:35:23 +02:00
x Add installation commands to x tool README 2020-12-21 17:18:48 -08:00
publish_toolstate.py Fix some Python2->3 error in publish_toolstate.py by type-checking it 2021-02-20 18:48:22 -05:00