]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/marker-types.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / marker-types.rs
1 // only-cdb
2 // compile-flags:-g
3
4 // === CDB TESTS ==================================================================================
5
6 // cdb-command: g
7
8 // cdb-command: dx nonnull
9 // cdb-check:nonnull          : NonNull(0x[...]: 0xc) [Type: core::ptr::non_null::NonNull<u32>]
10 // cdb-check:    [<Raw View>]     [Type: core::ptr::non_null::NonNull<u32>]
11 // cdb-check:    0xc [Type: unsigned int]
12
13 // cdb-command: dx manuallydrop
14 // cdb-check:manuallydrop     : 12345 [Type: core::mem::manually_drop::ManuallyDrop<i32>]
15 // cdb-check:    [<Raw View>]     [Type: core::mem::manually_drop::ManuallyDrop<i32>]
16
17 // cdb-command: dx pin
18 // cdb-check:pin              : Pin(0x[...]: "this") [Type: core::pin::Pin<ref_mut$<alloc::string::String> >]
19 // cdb-check:    [<Raw View>]     [Type: core::pin::Pin<ref_mut$<alloc::string::String> >]
20 // cdb-check:    [len]            : 0x4 [Type: unsigned [...]]
21 // cdb-check:    [capacity]       : 0x4 [Type: unsigned [...]]
22 // cdb-check:    [chars]          : "this"
23
24 // cdb-command: dx unique
25 // cdb-check:unique           : Unique(0x[...]: (0x2a, 4321)) [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
26 // cdb-check:    [<Raw View>]     [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
27 // cdb-check:    [0]              : 0x2a [Type: unsigned __int64]
28 // cdb-check:    [1]              : 4321 [Type: int]
29
30 #![feature(ptr_internals)]
31
32 use std::mem::ManuallyDrop;
33 use std::pin::Pin;
34 use std::ptr::{NonNull, Unique};
35
36 fn main() {
37     let nonnull: NonNull<_> = (&12u32).into();
38
39     let manuallydrop = ManuallyDrop::new(12345i32);
40
41     let mut s = "this".to_string();
42     let pin = Pin::new(&mut s);
43
44     let unique: Unique<_> = (&mut (42u64, 4321i32)).into();
45
46     zzz(); // #break
47 }
48
49 fn zzz() { }