about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaulingMonkey <git@maulingmonkey.com>2020-09-05 14:50:03 -0700
committerMaulingMonkey <git@maulingmonkey.com>2020-09-05 14:50:03 -0700
commit5acd272f5f7d892b73cfbe90bdf266af10ea30ce (patch)
treef1bfc7d4db0b49c8c8ef47f3fa692b7bbeeec569
parent81a769f261047afd8e31cc488b173b0ab5ac4205 (diff)
downloadrust-5acd272f5f7d892b73cfbe90bdf266af10ea30ce.tar.gz
rust-5acd272f5f7d892b73cfbe90bdf266af10ea30ce.zip
Fix HashMap visualizers in Visual Studio (Code)
CDB doesn't care that you're using static_cast between unrelated types.
VS(C) does.  These should've been reinterpret_cast or C casts.
Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
-rw-r--r--src/etc/natvis/libstd.natvis4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/natvis/libstd.natvis b/src/etc/natvis/libstd.natvis
index 4e81173d3d0..f791979800f 100644
--- a/src/etc/natvis/libstd.natvis
+++ b/src/etc/natvis/libstd.natvis
@@ -41,7 +41,7 @@
           <If Condition="(base.table.ctrl.pointer[i] &amp; 0x80) == 0">
             <!-- Bucket is populated -->
             <Exec>n--</Exec>
-            <Item Name="{static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__0}">static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__1</Item>
+            <Item Name="{((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__0}">((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__1</Item>
           </If>
           <Exec>i++</Exec>
         </Loop>
@@ -65,7 +65,7 @@
           <If Condition="(map.base.table.ctrl.pointer[i] &amp; 0x80) == 0">
             <!-- Bucket is populated -->
             <Exec>n--</Exec>
-            <Item>static_cast&lt;$T1*&gt;(map.base.table.ctrl.pointer)[-(i + 1)]</Item>
+            <Item>(($T1*)map.base.table.ctrl.pointer)[-(i + 1)]</Item>
           </If>
           <Exec>i++</Exec>
         </Loop>