Skip to content

Commit 075b13a

Browse files
committed
Update tests
1 parent ed68c58 commit 075b13a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎tests/unit/out/refcount/destructor.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ fn main_0() -> i32 {
183183
order_1.with(|rc| rc.borrow()[__idx])
184184
}) == 1)
185185
);
186+
let mut before: i32 = global_0.with(|rc| *rc.borrow());
187+
{
188+
let cs: Value<S> = Rc::new(RefCell::new(<S>::default()));
189+
let _dtor_cs = ScopedDestructor::new(&cs, |__p| __p.destructor());
190+
&(*cs.borrow_mut());
191+
}
192+
assert!((global_0.with(|rc| *rc.borrow()) == (before + 1)));
186193
return 0;
187194
}
188195
pub trait ArrayMemberImpl {

‎tests/unit/out/unsafe/destructor.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ unsafe fn main_0() -> i32 {
198198
assert!((((*std::cell::LazyCell::force_mut(&mut *&raw mut order_1))[(0) as usize]) == (3)));
199199
assert!((((*std::cell::LazyCell::force_mut(&mut *&raw mut order_1))[(1) as usize]) == (2)));
200200
assert!((((*std::cell::LazyCell::force_mut(&mut *&raw mut order_1))[(2) as usize]) == (1)));
201+
let mut before: i32 = (*std::cell::LazyCell::force_mut(&mut *&raw mut global_0));
202+
{
203+
let mut cs: S = <S>::default();
204+
let _dtor_cs = ScopedDestructorUnsafe::new(&raw mut cs, S::destructor);
205+
&(cs);
206+
}
207+
assert!(((*std::cell::LazyCell::force_mut(&mut *&raw mut global_0)) == ((before) + (1))));
201208
return 0;
202209
}
203210
pub unsafe fn __cpp2rust_init_globals() {

0 commit comments

Comments
 (0)