mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Add natvis for Duration, ManuallyDrop and Pin types
This commit is contained in:
parent
f2aba34eea
commit
691ee054d5
@ -34,6 +34,13 @@
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="core::mem::manually_drop::ManuallyDrop<*>">
|
||||
<DisplayString>{value}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>value</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="core::num::nonzero::NonZeroI8">
|
||||
<DisplayString>{__0}</DisplayString>
|
||||
</Type>
|
||||
@ -91,6 +98,13 @@
|
||||
<DisplayString>(..={end})</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="core::pin::Pin<*>">
|
||||
<DisplayString>Pin({(void*)pointer}: {pointer})</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>pointer</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="core::ptr::non_null::NonNull<*>">
|
||||
<DisplayString>NonNull({(void*) pointer}: {pointer})</DisplayString>
|
||||
<Expand>
|
||||
@ -138,4 +152,12 @@
|
||||
<Type Name="core::sync::atomic::AtomicUsize">
|
||||
<DisplayString>{v.value}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="core::time::Duration">
|
||||
<DisplayString>{secs,d}s {nanos,d}ns</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="seconds">secs</Item>
|
||||
<Item Name="nanoseconds">nanos</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
</AutoVisualizer>
|
||||
|
22
src/test/debuginfo/duration-type.rs
Normal file
22
src/test/debuginfo/duration-type.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// only-cdb
|
||||
// compile-flags:-g
|
||||
|
||||
// === CDB TESTS ==================================================================================
|
||||
|
||||
// cdb-command: g
|
||||
|
||||
// cdb-command: dx duration
|
||||
// cdb-check:duration : 5s 12ns [Type: core::time::Duration]
|
||||
// cdb-check: [<Raw View>] [Type: core::time::Duration]
|
||||
// cdb-check: seconds : 0x5 [Type: unsigned __int64]
|
||||
// cdb-check: nanoseconds : 0xc [Type: unsigned int]
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
let duration = Duration::new(5, 12);
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
fn zzz() { }
|
@ -10,11 +10,29 @@
|
||||
// cdb-check: [<Raw View>] [Type: core::ptr::non_null::NonNull<u32>]
|
||||
// cdb-checK: 0xc [Type: unsigned int]
|
||||
|
||||
// cdb-command: dx manuallydrop
|
||||
// cdb-check:manuallydrop : 12345 [Type: core::mem::manually_drop::ManuallyDrop<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: core::mem::manually_drop::ManuallyDrop<i32>]
|
||||
|
||||
// cdb-command: dx pin
|
||||
// cdb-check:pin : Pin(0x[...]: "this") [Type: core::pin::Pin<ref_mut$<alloc::string::String> >]
|
||||
// cdb-check: [<Raw View>] [Type: core::pin::Pin<ref_mut$<alloc::string::String> >]
|
||||
// cdb-check: [len] : 0x4 [Type: unsigned __int64]
|
||||
// cdb-check: [capacity] : 0x4 [Type: unsigned __int64]
|
||||
// cdb-check: [chars]
|
||||
|
||||
use std::mem::ManuallyDrop;
|
||||
use std::pin::Pin;
|
||||
use std::ptr::NonNull;
|
||||
|
||||
fn main() {
|
||||
let nonnull: NonNull<_> = (&12u32).into();
|
||||
|
||||
let manuallydrop = ManuallyDrop::new(12345i32);
|
||||
|
||||
let mut s = "this".to_string();
|
||||
let pin = Pin::new(&mut s);
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user