]> git.lizzy.rs Git - rust.git/blob - src/etc/natvis/liballoc.natvis
Rollup merge of #79208 - LeSeulArtichaut:stable-unsafe_op_in_unsafe_fn, r=nikomatsakis
[rust.git] / src / etc / natvis / liballoc.natvis
1 <?xml version="1.0" encoding="utf-8"?>
2 <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
3   <Type Name="alloc::vec::Vec&lt;*&gt;">
4     <DisplayString>{{ len={len} }}</DisplayString>
5     <Expand>
6       <Item Name="[len]" ExcludeView="simple">len</Item>
7       <Item Name="[capacity]" ExcludeView="simple">buf.cap</Item>
8       <ArrayItems>
9         <Size>len</Size>
10         <ValuePointer>buf.ptr.pointer</ValuePointer>
11       </ArrayItems>
12     </Expand>
13   </Type>
14   <Type Name="alloc::collections::vec_deque::VecDeque&lt;*&gt;">
15     <DisplayString>{{ len={tail &lt;= head ? head - tail : buf.cap - tail + head} }}</DisplayString>
16     <Expand>
17       <Item Name="[len]" ExcludeView="simple">tail &lt;= head ? head - tail : buf.cap - tail + head</Item>
18       <Item Name="[capacity]" ExcludeView="simple">buf.cap</Item>
19       <CustomListItems>
20         <Variable Name="i" InitialValue="tail" />
21
22         <Size>tail &lt;= head ? head - tail : buf.cap - tail + head</Size>
23         <Loop>
24           <If Condition="i == head">
25             <Break/>
26           </If>
27           <Item>buf.ptr.pointer[i]</Item>
28           <Exec>i = (i + 1 == buf.cap ? 0 : i + 1)</Exec>
29         </Loop>
30       </CustomListItems>
31     </Expand>
32   </Type>
33   <Type Name="alloc::collections::linked_list::LinkedList&lt;*&gt;">
34     <DisplayString>{{ len={len} }}</DisplayString>
35     <Expand>
36       <LinkedListItems>
37         <Size>len</Size>
38         <HeadPointer>*(alloc::collections::linked_list::Node&lt;$T1&gt; **)&amp;head</HeadPointer>
39         <NextPointer>*(alloc::collections::linked_list::Node&lt;$T1&gt; **)&amp;next</NextPointer>
40         <ValueNode>element</ValueNode>
41       </LinkedListItems>
42     </Expand>
43   </Type>
44   <Type Name="alloc::string::String">
45     <DisplayString>{(char*)vec.buf.ptr.pointer,[vec.len]s8}</DisplayString>
46     <StringView>(char*)vec.buf.ptr.pointer,[vec.len]s8</StringView>
47     <Expand>
48       <Item Name="[len]" ExcludeView="simple">vec.len</Item>
49       <Item Name="[capacity]" ExcludeView="simple">vec.buf.cap</Item>
50       <Synthetic Name="[chars]">
51         <Expand>
52           <ArrayItems>
53             <Size>vec.len</Size>
54             <ValuePointer>(char*)vec.buf.ptr.pointer</ValuePointer>
55           </ArrayItems>
56         </Expand>
57       </Synthetic>
58     </Expand>
59   </Type>
60   <Type Name="alloc::rc::Rc&lt;*&gt;">
61     <DisplayString>{ptr.pointer->value}</DisplayString>
62     <Expand>
63       <ExpandedItem>ptr.pointer->value</ExpandedItem>
64     </Expand>
65   </Type>
66   <Type Name="alloc::sync::Arc&lt;*&gt;">
67     <DisplayString>{ptr.pointer->data}</DisplayString>
68     <Expand>
69       <ExpandedItem>ptr.pointer->data</ExpandedItem>
70     </Expand>
71   </Type>
72   <Type Name="alloc::sync::Weak&lt;*&gt;">
73     <DisplayString>{ptr.pointer->data}</DisplayString>
74     <Expand>
75       <ExpandedItem>ptr.pointer->data</ExpandedItem>
76     </Expand>
77   </Type>
78   <Type Name="alloc::borrow::Cow&lt;*&gt;">
79     <DisplayString Condition="RUST$ENUM$DISR == 0x0">Borrowed({__0})</DisplayString>
80     <DisplayString Condition="RUST$ENUM$DISR == 0x1">Owned({__0})</DisplayString>
81     <Expand>
82       <Item Name="[value]" ExcludeView="simple">__0</Item>
83     </Expand>
84   </Type>
85 </AutoVisualizer>