diff options
| author | MaulingMonkey <git@maulingmonkey.com> | 2020-06-24 19:28:12 -0700 |
|---|---|---|
| committer | MaulingMonkey <git@maulingmonkey.com> | 2020-06-24 19:28:12 -0700 |
| commit | f8eb81ba4e85b02d90cfc33fcba0a6a7d5cbf810 (patch) | |
| tree | 44bfb6a6e00309ba576b916693b2f3b0679e433d /src/librustc_codegen_ssa/debuginfo | |
| parent | 67100f61e62a86f2bf9e38552ee138e231eddc74 (diff) | |
| download | rust-f8eb81ba4e85b02d90cfc33fcba0a6a7d5cbf810.tar.gz rust-f8eb81ba4e85b02d90cfc33fcba0a6a7d5cbf810.zip | |
Modify type names on MSVC to make tuples .natvis compatible.
- Mangles (T0, T1) as tuple<T0, T1>, possibly unblocking rust-lang/rust#70052 "Update hashbrown to 0.8.0" - Prettifies Rust tuples similar to VS2017's std::tuple - Improves debuginfo test coverage
Diffstat (limited to 'src/librustc_codegen_ssa/debuginfo')
| -rw-r--r-- | src/librustc_codegen_ssa/debuginfo/type_names.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/debuginfo/type_names.rs b/src/librustc_codegen_ssa/debuginfo/type_names.rs index a64489c04c8..20d440433cb 100644 --- a/src/librustc_codegen_ssa/debuginfo/type_names.rs +++ b/src/librustc_codegen_ssa/debuginfo/type_names.rs @@ -47,7 +47,12 @@ pub fn push_debuginfo_type_name<'tcx>( push_type_params(tcx, substs, output, visited); } ty::Tuple(component_types) => { - output.push('('); + if cpp_like_names { + output.push_str("tuple<"); + } else { + output.push('('); + } + for component_type in component_types { push_debuginfo_type_name(tcx, component_type.expect_ty(), true, output, visited); output.push_str(", "); @@ -56,7 +61,12 @@ pub fn push_debuginfo_type_name<'tcx>( output.pop(); output.pop(); } - output.push(')'); + + if cpp_like_names { + output.push('>'); + } else { + output.push(')'); + } } ty::RawPtr(ty::TypeAndMut { ty: inner_type, mutbl }) => { if !cpp_like_names { |
