From 0cd2dd7263a20ba62591039cd3591c8eaef13878 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Tue, 25 Oct 2022 12:28:03 +0200 Subject: [debuginfo] Make debuginfo type names for slices and str consistent. Before this PR, the compiler would emit the debuginfo name `slice$` 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 >` 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` and `Foo<&str>` would be the same. In contrast, `*const [bool]` and `*mut [bool]` would be `ptr_const$ >` and `ptr_mut$ >`, 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$ >`, `ref_mut$ >`, and `ref$` respectively -- as one would expect. --- src/etc/natvis/intrinsic.natvis | 12 ++++++++++-- src/etc/natvis/liballoc.natvis | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/etc') diff --git a/src/etc/natvis/intrinsic.natvis b/src/etc/natvis/intrinsic.natvis index 277e57aaf6f..8c16a562e34 100644 --- a/src/etc/natvis/intrinsic.natvis +++ b/src/etc/natvis/intrinsic.natvis @@ -1,6 +1,10 @@  - + + + + + {(char*)data_ptr,[length]s8} (char*)data_ptr,[length]s8 @@ -15,7 +19,11 @@ - + + + + + {{ len={length} }} length diff --git a/src/etc/natvis/liballoc.natvis b/src/etc/natvis/liballoc.natvis index bf6c02b9146..41f4a3767f5 100644 --- a/src/etc/natvis/liballoc.natvis +++ b/src/etc/natvis/liballoc.natvis @@ -85,7 +85,7 @@ - + {{ len={ptr.pointer.length} }} ptr.pointer.length @@ -115,7 +115,7 @@ - + {{ len={ptr.pointer.length} }} ptr.pointer.length @@ -144,7 +144,7 @@ - + {{ len={ptr.pointer.length} }} ptr.pointer.length @@ -173,7 +173,7 @@ - + {{ len={ptr.pointer.length} }} ptr.pointer.length -- cgit 1.4.1-3-g733a5