summary refs log tree commit diff
path: root/src/test/debuginfo
diff options
context:
space:
mode:
authorWesley Wiser <wesleywiser@microsoft.com>2021-06-30 12:08:58 -0400
committerWesley Wiser <wesleywiser@microsoft.com>2021-07-08 12:55:49 -0400
commit691ee054d5bb8e0a95fd0486a7167bd8889ebba7 (patch)
tree7449fdf68eca09e2fdbf64ce5b2463dd109100e4 /src/test/debuginfo
parentf2aba34eea86a1e3c1ebdd0b8f7adfc730169518 (diff)
downloadrust-691ee054d5bb8e0a95fd0486a7167bd8889ebba7.tar.gz
rust-691ee054d5bb8e0a95fd0486a7167bd8889ebba7.zip
Add natvis for Duration, ManuallyDrop and Pin types
Diffstat (limited to 'src/test/debuginfo')
-rw-r--r--src/test/debuginfo/duration-type.rs22
-rw-r--r--src/test/debuginfo/marker-types.rs18
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/debuginfo/duration-type.rs b/src/test/debuginfo/duration-type.rs
new file mode 100644
index 00000000000..3a7f9f78b5f
--- /dev/null
+++ b/src/test/debuginfo/duration-type.rs
@@ -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() { }
diff --git a/src/test/debuginfo/marker-types.rs b/src/test/debuginfo/marker-types.rs
index 43e45d8f282..de4e8311a4f 100644
--- a/src/test/debuginfo/marker-types.rs
+++ b/src/test/debuginfo/marker-types.rs
@@ -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
 }