Add test for Unique<T>
, weak ref counts and ref counts for Weak<T>
This commit is contained in:
parent
d1852e1054
commit
14fdf8a115
@ -64,12 +64,15 @@
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="alloc::rc::Weak<*>">
|
||||
<DisplayString>{ptr.pointer->value}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
@ -78,12 +81,15 @@
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="alloc::sync::Weak<*>">
|
||||
<DisplayString>{ptr.pointer->data}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="alloc::borrow::Cow<*>">
|
||||
|
@ -21,9 +21,17 @@
|
||||
// cdb-check: [capacity] : 0x4 [Type: unsigned __int64]
|
||||
// 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;
|
||||
use std::ptr::{NonNull, Unique};
|
||||
|
||||
fn main() {
|
||||
let nonnull: NonNull<_> = (&12u32).into();
|
||||
@ -33,6 +41,8 @@ fn main() {
|
||||
let mut s = "this".to_string();
|
||||
let pin = Pin::new(&mut s);
|
||||
|
||||
let unique: Unique<_> = (&mut (42u64, 4321i32)).into();
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
|
@ -31,29 +31,37 @@
|
||||
// cdb-check:r,d : 42 [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx r1,d
|
||||
// cdb-check:r1,d : 42 [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx w1,d
|
||||
// cdb-check:w1,d : 42 [Type: alloc::rc::Weak<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx a,d
|
||||
// cdb-check:a,d : 42 [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx a1,d
|
||||
// cdb-check:a1,d : 42 [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx w2,d
|
||||
// cdb-check:w2,d : 42 [Type: alloc::sync::Weak<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user