Skip to content

Commit 36a7785

Browse files
committed
fix test output
1 parent 8d33dbf commit 36a7785

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ pub struct node_b {
2828
pub data: Value<AnyPtr>,
2929
pub next: Value<Ptr<node_b>>,
3030
}
31-
impl ByteRepr for node_b {}
31+
impl ByteRepr for node_b {
32+
fn byte_size() -> usize {
33+
16
34+
}
35+
fn to_bytes(&self, buf: &mut [u8]) {
36+
(*self.data.borrow()).to_bytes(&mut buf[0..8]);
37+
(*self.next.borrow()).to_bytes(&mut buf[8..16]);
38+
}
39+
fn from_bytes(buf: &[u8]) -> Self {
40+
Self {
41+
data: Rc::new(RefCell::new(<AnyPtr>::from_bytes(&buf[0..8]))),
42+
next: Rc::new(RefCell::new(<Ptr<node_b>>::from_bytes(&buf[8..16]))),
43+
}
44+
}
45+
}
3246
pub fn main() {
3347
std::process::exit(main_0());
3448
}

0 commit comments

Comments
 (0)