about summary refs log tree commit diff
path: root/src/test/debuginfo/pretty-std.rs
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2022-10-25 12:28:03 +0200
committerMichael Woerister <michaelwoerister@posteo>2022-10-31 15:43:44 +0100
commit0cd2dd7263a20ba62591039cd3591c8eaef13878 (patch)
tree7a9b322b39dc101763de59789b716dd70cd9c88b /src/test/debuginfo/pretty-std.rs
parent1481fd964bac3c750c7e1b21206fdaa60346c456 (diff)
downloadrust-0cd2dd7263a20ba62591039cd3591c8eaef13878.tar.gz
rust-0cd2dd7263a20ba62591039cd3591c8eaef13878.zip
[debuginfo] Make 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.
Diffstat (limited to 'src/test/debuginfo/pretty-std.rs')
-rw-r--r--src/test/debuginfo/pretty-std.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/debuginfo/pretty-std.rs b/src/test/debuginfo/pretty-std.rs
index a51b37205e8..d8c6344e0b6 100644
--- a/src/test/debuginfo/pretty-std.rs
+++ b/src/test/debuginfo/pretty-std.rs
@@ -69,7 +69,7 @@
 // cdb-command: g
 
 // cdb-command: dx slice,d
-// cdb-check:slice,d          : { len=4 } [Type: slice$<i32>]
+// cdb-check:slice,d          : { len=4 } [Type: ref$<slice2$<i32> >]
 // cdb-check:    [len]            : 4 [Type: [...]]
 // cdb-check:    [0]              : 0 [Type: int]
 // cdb-check:    [1]              : 1 [Type: int]
@@ -86,7 +86,7 @@
 // cdb-check:    [3]              : 7 [Type: unsigned __int64]
 
 // cdb-command: dx str_slice
-// cdb-check:str_slice        : "IAMA string slice!" [Type: str]
+// cdb-check:str_slice        : "IAMA string slice!" [Type: ref$<str$>]
 
 // cdb-command: dx string
 // cdb-check:string           : "IAMA string!" [Type: [...]::String]