Stop adding '*' at the end of type names for Ref and Slice when computing debug info for MSVC debuggers

This commit is contained in:
Nam Nguyen 2020-11-18 13:42:36 -08:00
parent 7d747db0d5
commit 36e6aa0aa6
1 changed files with 8 additions and 1 deletions

View File

@ -94,7 +94,14 @@ pub fn push_debuginfo_type_name<'tcx>(
push_debuginfo_type_name(tcx, inner_type, true, output, visited);
if cpp_like_names {
output.push('*');
// Slices and `&str` are treated like C++ pointers when computing debug
// info for MSVC debugger. However, adding '*' at the end of these types' names
// causes the .natvis engine for WinDbg to fail to display their data, so we opt these
// types out to aid debugging in MSVC.
match *inner_type.kind() {
ty::Slice(_) | ty::Str => {}
_ => output.push('*'),
}
}
}
ty::Array(inner_type, len) => {