diff options
| author | Markus Everling <markuseverling@gmail.com> | 2022-11-27 15:55:13 +0100 |
|---|---|---|
| committer | Markus Everling <markuseverling@gmail.com> | 2022-11-27 18:09:56 +0100 |
| commit | cd68bd9baba18496ae8ecb9ac652d884ebc0b79d (patch) | |
| tree | 5b7103b11f536057915bdbc5039e935916a3dd82 /src | |
| parent | acf95adfe2e1cee70ddb30abc42f1c47becbdc55 (diff) | |
| download | rust-cd68bd9baba18496ae8ecb9ac652d884ebc0b79d.tar.gz rust-cd68bd9baba18496ae8ecb9ac652d884ebc0b79d.zip | |
Fix natvis `VecDeque` formatter
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/natvis/liballoc.natvis | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/etc/natvis/liballoc.natvis b/src/etc/natvis/liballoc.natvis index 41f4a3767f5..c4ad98ec1d3 100644 --- a/src/etc/natvis/liballoc.natvis +++ b/src/etc/natvis/liballoc.natvis @@ -12,20 +12,19 @@ </Expand> </Type> <Type Name="alloc::collections::vec_deque::VecDeque<*>"> - <DisplayString>{{ len={tail <= head ? head - tail : buf.cap - tail + head} }}</DisplayString> + <DisplayString>{{ len={len} }}</DisplayString> <Expand> - <Item Name="[len]" ExcludeView="simple">tail <= head ? head - tail : buf.cap - tail + head</Item> + <Item Name="[len]" ExcludeView="simple">len</Item> <Item Name="[capacity]" ExcludeView="simple">buf.cap</Item> <CustomListItems> - <Variable Name="i" InitialValue="tail" /> - - <Size>tail <= head ? head - tail : buf.cap - tail + head</Size> + <Variable Name="i" InitialValue="0" /> + <Size>len</Size> <Loop> - <If Condition="i == head"> + <If Condition="i == len"> <Break/> </If> - <Item>buf.ptr.pointer.pointer[i]</Item> - <Exec>i = (i + 1 == buf.cap ? 0 : i + 1)</Exec> + <Item>buf.ptr.pointer.pointer[(i + head) % buf.cap]</Item> + <Exec>i = i + 1</Exec> </Loop> </CustomListItems> </Expand> |
