From f6d2843d6879b5741ab716bd8ca826c2ac5414cb Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Wed, 30 Jun 2021 21:53:48 -0400 Subject: [PATCH] Respond to review feedback --- compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 2 +- src/test/debuginfo/msvc-pretty-enums.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 78709a1abe7..7e136c1b24c 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1545,7 +1545,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> { // {name} discriminant; // } // ``` - // The natvis in `intrinsic.nativs` then matches on `this.discriminant` to + // The natvis in `intrinsic.natvis` then matches on `this.discriminant` to // determine which variant is active and then displays it. let enum_layout = self.layout; let offset = enum_layout.fields.offset(tag_field); diff --git a/src/test/debuginfo/msvc-pretty-enums.rs b/src/test/debuginfo/msvc-pretty-enums.rs index 00e910669b9..b03650e857a 100644 --- a/src/test/debuginfo/msvc-pretty-enums.rs +++ b/src/test/debuginfo/msvc-pretty-enums.rs @@ -1,10 +1,14 @@ // only-cdb +// ignore-tidy-linelength // compile-flags:-g // cdb-command: g // Note: The natvis used to visualize niche-layout enums don't work correctly in cdb -// so the best we can do is to make sure we are generating the right debuginfo +// so the best we can do is to make sure we are generating the right debuginfo. +// Therefore, we use the `!` [format specifier](https://docs.microsoft.com/en-us/visualstudio/debugger/format-specifiers-in-cpp?view=vs-2019#BKMK_Visual_Studio_2012_format_specifiers) +// to disable the natvis for a given expression. We also provide the `-r2` flag +// to expand the expression 2 levels. // cdb-command: dx -r2 a,! // cdb-check:a,! [Type: enum$ >, 2, 16, Some>]