rust/src
bors 2545459bff Auto merge of #85269 - dpaoliello:dpaoliello/DebugSymbols, r=michaelwoerister
Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger

There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types).

Instead, each debug symbol name should be unique and useful:
* Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified.
* Qualify the principal trait for dynamic types.
* If there is no principal trait for a dynamic type, emit all other traits instead.
* Respect the `qualified` argument when emitting ref and pointer types.
* For implementations, emit the disambiguator.
* Print const generics when emitting generic parameters or arguments.

Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly:
* Avoid characters with special meaning (`#`, `[`, `"`, `+`).
* Never start a name with `<` or `{` as this is treated as an operator.
* `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this).
* Emit function declarations using C/C++ style syntax (e.g., leading return type).
* Emit arrays as a synthetic `array$<type, size>` type.
* Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
2021-07-02 17:19:32 +00:00
..
bootstrap Rollup merge of #86737 - jyn514:doc-tools, r=Mark-Simulacrum 2021-07-02 11:35:29 +02:00
build_helper Revert "Revert "Move llvm submodule updates to rustbuild"" 2021-06-04 22:17:01 -04:00
ci Update container browser-ui-test@0.4.1 2021-07-01 10:22:03 +02:00
doc Update to new bootstrap compiler 2021-06-28 11:30:49 -04:00
etc Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger 2021-06-30 11:10:29 -07:00
librustdoc Rollup merge of #85749 - GuillaumeGomez:revert-smart-extern-crate-load, r=jyn514 2021-07-02 11:35:27 +02:00
llvm-project@39c5555872 Update LLVM submodule 2021-05-23 18:05:11 +10:00
rustdoc-json-types rustdoc- Show defaults on const generics 2021-06-03 09:01:25 +01:00
test Auto merge of #85269 - dpaoliello:dpaoliello/DebugSymbols, r=michaelwoerister 2021-07-02 17:19:32 +00:00
tools Auto merge of #85269 - dpaoliello:dpaoliello/DebugSymbols, r=michaelwoerister 2021-07-02 17:19:32 +00:00
README.md
stage0.txt Update to new bootstrap compiler 2021-06-28 11:30:49 -04:00
version Bump to 1.54 2021-06-11 19:19:55 -04:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.