Skip to content

Commit 9bc912a

Browse files
committed
Update tests
1 parent 45555a7 commit 9bc912a

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,9 @@ pub struct V {
124124
impl std::cmp::Ord for V {
125125
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
126126
{
127-
if operator_lt_8(
128-
Rc::new(RefCell::new(V { v: self.v.clone() })).as_pointer(),
129-
Rc::new(RefCell::new(V { v: other.v.clone() })).as_pointer(),
130-
) {
127+
if operator_lt_8(self.clone(), other.clone()) {
131128
std::cmp::Ordering::Less
132-
} else if operator_lt_8(
133-
Rc::new(RefCell::new(V { v: other.v.clone() })).as_pointer(),
134-
Rc::new(RefCell::new(V { v: self.v.clone() })).as_pointer(),
135-
) {
129+
} else if operator_lt_8(other.clone(), self.clone()) {
136130
std::cmp::Ordering::Greater
137131
} else {
138132
std::cmp::Ordering::Equal
@@ -147,12 +141,7 @@ impl std::cmp::PartialOrd for V {
147141
}
148142
impl std::cmp::PartialEq for V {
149143
fn eq(&self, other: &Self) -> bool {
150-
{
151-
operator_eq_9(
152-
Rc::new(RefCell::new(V { v: self.v.clone() })).as_pointer(),
153-
Rc::new(RefCell::new(V { v: other.v.clone() })).as_pointer(),
154-
)
155-
}
144+
{ operator_eq_9(self.clone(), other.clone()) }
156145
}
157146
}
158147
impl std::cmp::Eq for V {}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pub struct V {
6767
impl std::cmp::Ord for V {
6868
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
6969
unsafe {
70-
if operator_lt_8(self as *const V, other as *const V) {
70+
if operator_lt_8(self.clone(), other.clone()) {
7171
std::cmp::Ordering::Less
72-
} else if operator_lt_8(other as *const V, self as *const V) {
72+
} else if operator_lt_8(other.clone(), self.clone()) {
7373
std::cmp::Ordering::Greater
7474
} else {
7575
std::cmp::Ordering::Equal
@@ -84,7 +84,7 @@ impl std::cmp::PartialOrd for V {
8484
}
8585
impl std::cmp::PartialEq for V {
8686
fn eq(&self, other: &Self) -> bool {
87-
unsafe { operator_eq_9(self as *const V, other as *const V) }
87+
unsafe { operator_eq_9(self.clone(), other.clone()) }
8888
}
8989
}
9090
impl std::cmp::Eq for V {}

0 commit comments

Comments
 (0)