summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/marker-types.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/debuginfo/marker-types.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/marker-types.rs')
-rw-r--r--tests/debuginfo/marker-types.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/debuginfo/marker-types.rs b/tests/debuginfo/marker-types.rs
new file mode 100644
index 000000000..8373d7856
--- /dev/null
+++ b/tests/debuginfo/marker-types.rs
@@ -0,0 +1,49 @@
+// only-cdb
+// compile-flags:-g
+
+// === CDB TESTS ==================================================================================
+
+// cdb-command: g
+
+// cdb-command: dx nonnull
+// cdb-check:nonnull : NonNull(0x[...]: 0xc) [Type: core::ptr::non_null::NonNull<u32>]
+// 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 [...]]
+// cdb-check: [capacity] : 0x4 [Type: unsigned [...]]
+// cdb-check: [chars] : "this"
+
+// cdb-command: dx unique
+// cdb-check:unique : Unique(0x[...]: (0x2a, 4321)) [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
+// cdb-check: [<Raw View>] [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
+// cdb-check: [0] : 0x2a [Type: unsigned __int64]
+// cdb-check: [1] : 4321 [Type: int]
+
+#![feature(ptr_internals)]
+
+use std::mem::ManuallyDrop;
+use std::pin::Pin;
+use std::ptr::{NonNull, Unique};
+
+fn main() {
+ let nonnull: NonNull<_> = (&12u32).into();
+
+ let manuallydrop = ManuallyDrop::new(12345i32);
+
+ let mut s = "this".to_string();
+ let pin = Pin::new(&mut s);
+
+ let unique: Unique<_> = (&mut (42u64, 4321i32)).into();
+
+ zzz(); // #break
+}
+
+fn zzz() { }