diff options
| author | Wesley Wiser <wesleywiser@microsoft.com> | 2021-06-25 13:33:00 -0400 |
|---|---|---|
| committer | Wesley Wiser <wesleywiser@microsoft.com> | 2021-07-02 20:16:37 -0400 |
| commit | d94f087848ee05036769bd4dc78337ab3604a776 (patch) | |
| tree | edaa85b82e408ccead0f5c21696d18f388f85d48 /src/test/debuginfo | |
| parent | f24355896ba0986e4d27eff45084f704ec7e7948 (diff) | |
| download | rust-d94f087848ee05036769bd4dc78337ab3604a776.tar.gz rust-d94f087848ee05036769bd4dc78337ab3604a776.zip | |
Show the variant name for univariant enums
Previously, only the fields would be displayed with no indication of the variant name. If you already knew the enum was univariant, this was ok but if the enum was univariant because of layout, for example, a `Result<T, !>` then it could be very confusing which variant was the active one.
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/msvc-pretty-enums.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/debuginfo/msvc-pretty-enums.rs b/src/test/debuginfo/msvc-pretty-enums.rs index 67a67863f34..00e910669b9 100644 --- a/src/test/debuginfo/msvc-pretty-enums.rs +++ b/src/test/debuginfo/msvc-pretty-enums.rs @@ -82,6 +82,11 @@ // cdb-check: [+0x000] __0 [Type: alloc::string::String] // cdb-check: [+0x000] discriminant : 0x[...] [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>::Discriminant$] +// cdb-command: dx -r2 l,! +// cdb-check:l,! : $T2 [Type: enum$<core::result::Result<u32, enum$<msvc_pretty_enums::Empty> >, Ok>] +// cdb-check: [+0x000] Ok [Type: enum$<core::result::Result<u32, enum$<msvc_pretty_enums::Empty> >, Ok>::Ok] +// cdb-check: [+0x000] __0 : 0x2a [Type: unsigned int] + pub enum CStyleEnum { Low = 2, High = 16, @@ -93,6 +98,8 @@ pub enum NicheLayoutEnum { Tag2, } +pub enum Empty { } + fn main() { let a = Some(CStyleEnum::Low); let b = Option::<CStyleEnum>::None; @@ -105,6 +112,7 @@ fn main() { let i = Option::<u32>::None; let j = CStyleEnum::High; let k = Some("IAMA optional string!".to_string()); + let l = Result::<u32, Empty>::Ok(42); zzz(); // #break } |
