Skip to content

Commit 11dd0c9

Browse files
committed
Update tests
1 parent 92f7cf4 commit 11dd0c9

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎rules/any/tgt_refcount.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ fn f1() -> Option<Rc<dyn std::any::Any>> {
1313
None
1414
}
1515

16-
fn f6(a0: Ptr<Option<Rc<dyn std::any::Any>>>) {
17-
a0.with_mut(|__a: &mut Option<Rc<dyn std::any::Any>>| *__a = None)
16+
fn f6(a0: &mut Option<Rc<dyn std::any::Any>>) {
17+
*a0 = None
1818
}
1919

2020
fn f8(a0: Option<Rc<dyn std::any::Any>>) -> bool {
2121
a0.is_some()
2222
}
2323

24-
fn f14<T1: 'static>(a0: Ptr<Option<Rc<dyn std::any::Any>>>, init: cpp_type!("std::decay_t<T1>", T1)) -> Ptr<T1> {
24+
fn f14<T1: 'static>(a0: &mut Option<Rc<dyn std::any::Any>>, init: cpp_type!("std::decay_t<T1>", T1)) -> Ptr<T1> {
2525
let __value: Value<T1> = Rc::new(RefCell::new(init));
2626
let __ptr = __value.as_pointer();
27-
a0.with_mut(|__a: &mut Option<Rc<dyn std::any::Any>>| *__a = Some(__value));
27+
*a0 = Some(__value);
2828
__ptr
2929
}
3030

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ fn main_0() -> i32 {
5050
let q: Ptr<Point> = {
5151
let __value: Value<Point> = Rc::new(RefCell::new(Point::new({ 5 }, { 6 })));
5252
let __ptr = __value.as_pointer();
53-
a.as_pointer()
54-
.with_mut(|__a: &mut Option<Rc<dyn std::any::Any>>| *__a = Some(__value));
53+
(*a.borrow_mut()) = Some(__value);
5554
__ptr
5655
};
5756
assert!((q.with(|__s| __s.x) == 5));
@@ -79,8 +78,7 @@ fn main_0() -> i32 {
7978
.read())
8079
== 7)
8180
);
82-
b.as_pointer()
83-
.with_mut(|__a: &mut Option<Rc<dyn std::any::Any>>| *__a = None);
81+
(*b.borrow_mut()) = None;
8482
assert!(!((*b.borrow()).is_some()));
8583
assert!(
8684
((b.as_pointer()).with(|__a: &Option<Rc<dyn std::any::Any>>| {

0 commit comments

Comments
 (0)