Skip to content

Commit cd68bd9

Browse files
committedNov 27, 2022
Fix natvis VecDeque formatter
1 parent acf95ad commit cd68bd9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed
 

‎src/etc/natvis/liballoc.natvis

+7-8
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@
1212
</Expand>
1313
</Type>
1414
<Type Name="alloc::collections::vec_deque::VecDeque&lt;*&gt;">
15-
<DisplayString>{{ len={tail &lt;= head ? head - tail : buf.cap - tail + head} }}</DisplayString>
15+
<DisplayString>{{ len={len} }}</DisplayString>
1616
<Expand>
17-
<Item Name="[len]" ExcludeView="simple">tail &lt;= head ? head - tail : buf.cap - tail + head</Item>
17+
<Item Name="[len]" ExcludeView="simple">len</Item>
1818
<Item Name="[capacity]" ExcludeView="simple">buf.cap</Item>
1919
<CustomListItems>
20-
<Variable Name="i" InitialValue="tail" />
21-
22-
<Size>tail &lt;= head ? head - tail : buf.cap - tail + head</Size>
20+
<Variable Name="i" InitialValue="0" />
21+
<Size>len</Size>
2322
<Loop>
24-
<If Condition="i == head">
23+
<If Condition="i == len">
2524
<Break/>
2625
</If>
27-
<Item>buf.ptr.pointer.pointer[i]</Item>
28-
<Exec>i = (i + 1 == buf.cap ? 0 : i + 1)</Exec>
26+
<Item>buf.ptr.pointer.pointer[(i + head) % buf.cap]</Item>
27+
<Exec>i = i + 1</Exec>
2928
</Loop>
3029
</CustomListItems>
3130
</Expand>

0 commit comments

Comments
 (0)