rust/src/test
bors b0f3940c35 Auto merge of #103691 - michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo-names, r=wesleywiser
[debuginfo] Make cpp-like debuginfo type names for slices and str consistent.

Before this PR, the compiler would emit the debuginfo name `slice$<T>` for all kinds of slices, regardless of whether they are behind a reference or not and regardless of the kind of reference. As a consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>` would end up with the same type name `Foo<slice$<T> >` in debuginfo, making it impossible to disambiguate between them by name. Similarly, `&str` would get the name `str` in debuginfo, so the debuginfo name for `Foo<str>` and `Foo<&str>` would be the same. In contrast, `*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >` and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose information about the type.

This PR removes all special handling for slices and `str`. The types `&[bool]`, `&mut [bool]`, and `&str` thus get the names `ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and `ref$<str$>` respectively -- as one would expect.

The new special name for slices is `slice2$` to differentiate it from the previous name `slice$`, which has different semantics. The same is true for `str` and `str$`. This kind of versioning already has a precedent with the case of `enum$` and `enum2$` and hopefully will make it easier to transition existing consumers of these names.

cc `@rust-lang/wg-debugging` `@vadimcn`

r? `@wesleywiser`

UPDATE: Here is a table to clarify the changes

| Rust type | DWARF name | C++-like name (before) | C++-like name (after) |
|-----------|------------|------------------------|------------------------|
| `[T]`        | `[T]`        | `slice$<T>`              | `slice2$<T>`           |
| `&[T]`       | `&[T]`       | `slice$<T>`              | `ref$<slice2$<T> >`    |
| `&mut [T]`   | `&mut [T]`   | `slice$<T>`              | `ref_mut$<slice2$<T> >`|
| `str`        | `str`        | `str`                    | `str$`           |
| `&str`       | `&str`       | `str`                    | `ref$<str$>`    |
| `&mut str`   | `&mut str`   | `str`                    | `ref_mut$<str$>`|
| `*const [T]` | `*const [T]` | `ptr_const$<slice$<T> >` | `ptr_const$<slice2$<T> >` |
| `*mut [T]`   | `*mut [T]`   | `ptr_mut$<slice$<T> >`   | `ptr_mut$<slice2$<T> >` |

As you can see, before the PR many types would end up with the same name, making it impossible to distinguish between them in NatVis or other places where types are matched or looked up by name. The DWARF version of names is not changed.
2022-11-05 11:07:50 +00:00
..
assembly Stabilize asm_sym 2022-10-17 22:38:37 +01:00
auxiliary
codegen LLVM 16: Switch to using MemoryEffects 2022-11-04 17:58:16 +00:00
codegen-units Bless cgu test. 2022-09-23 18:42:14 +02:00
debuginfo [debuginfo] Make debuginfo type names for slices and str consistent. 2022-10-31 15:43:44 +01:00
incremental Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errors 2022-10-13 22:39:05 +00:00
mir-opt Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
pretty Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726 2022-10-24 19:32:25 +09:00
run-make Print valid --print requests if request is invalid 2022-11-01 16:24:01 +01:00
run-make-fulldeps Rollup merge of #103681 - RalfJung:libtest-thread, r=thomcc 2022-11-04 18:52:26 +01:00
run-pass-valgrind Fix test 2022-10-13 17:46:33 +01:00
rustdoc Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomez 2022-11-04 06:40:31 +01:00
rustdoc-gui rustdoc: get rid of CSS/DOM div.desc span, which isn't really needed 2022-11-04 13:19:33 -07:00
rustdoc-js Add regression test for reexports in search results 2022-10-30 13:58:00 +01:00
rustdoc-js-std Update asrawfd.js. 2022-08-29 08:31:42 -07:00
rustdoc-json Add regression test for missing item from private mod in JSON output 2022-10-29 11:56:08 +02:00
rustdoc-ui roll another resolution logic in rustdoc 2022-11-03 15:09:02 +00:00
ui Rollup merge of #103994 - clubby789:break-unlabeled, r=TaKO8Ki 2022-11-05 11:31:30 +05:30
ui-fulldeps Remove #[suggestion_*] attributes 2022-10-26 15:04:09 +02:00
COMPILER_TESTS.md