summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/marker-types.rs
blob: 8373d7856bb376a5093cdfa9ef32d37dfd8b2d93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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() { }