From 26689e4485d396656db1d231f0b2de1661e68484 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 29 Apr 2024 13:22:56 +0200 Subject: [PATCH] Remove redundant Pod and Zeroable derives for zero_copy structs They were causing errors with some rust versions. --- programs/openbook-v2/src/state/orderbook/heap.rs | 2 +- programs/openbook-v2/src/state/orderbook/nodes.rs | 1 - programs/openbook-v2/src/state/orderbook/ordertree.rs | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/programs/openbook-v2/src/state/orderbook/heap.rs b/programs/openbook-v2/src/state/orderbook/heap.rs index d2ef2452e..05b52cd66 100644 --- a/programs/openbook-v2/src/state/orderbook/heap.rs +++ b/programs/openbook-v2/src/state/orderbook/heap.rs @@ -217,7 +217,7 @@ impl EventNode { const EVENT_SIZE: usize = 144; #[zero_copy] -#[derive(Debug, bytemuck::Pod, bytemuck::Zeroable)] +#[derive(Debug)] pub struct AnyEvent { pub event_type: u8, pub padding: [u8; 143], diff --git a/programs/openbook-v2/src/state/orderbook/nodes.rs b/programs/openbook-v2/src/state/orderbook/nodes.rs index 748e763d9..aa5d3a57b 100644 --- a/programs/openbook-v2/src/state/orderbook/nodes.rs +++ b/programs/openbook-v2/src/state/orderbook/nodes.rs @@ -247,7 +247,6 @@ const_assert_eq!(size_of::(), NODE_SIZE); const_assert_eq!(size_of::() % 8, 0); #[zero_copy] -#[derive(bytemuck::Pod, bytemuck::Zeroable)] pub struct AnyNode { pub tag: u8, pub data: [u8; 87], diff --git a/programs/openbook-v2/src/state/orderbook/ordertree.rs b/programs/openbook-v2/src/state/orderbook/ordertree.rs index 41096b996..02ca9baed 100644 --- a/programs/openbook-v2/src/state/orderbook/ordertree.rs +++ b/programs/openbook-v2/src/state/orderbook/ordertree.rs @@ -36,7 +36,6 @@ impl OrderTreeType { } #[zero_copy] -#[derive(bytemuck::Pod, bytemuck::Zeroable)] pub struct OrderTreeRoot { pub maybe_node: NodeHandle, pub leaf_count: u32, @@ -58,7 +57,6 @@ impl OrderTreeRoot { /// /// The key encodes the price in the top 64 bits. #[zero_copy] -#[derive(bytemuck::Pod, bytemuck::Zeroable)] pub struct OrderTreeNodes { pub order_tree_type: u8, // OrderTreeType, but that's not POD pub padding: [u8; 3],