From 7062c89b4f175b3e3b55567ee560097e7b57c91e Mon Sep 17 00:00:00 2001 From: Adrien Bennadji Date: Thu, 21 Mar 2024 19:24:08 +0100 Subject: [PATCH] rust 1.77 offset_of --- Cargo.toml | 3 ++- src/main.rs | 1 - src/offset.rs | 10 ---------- src/vertex.rs | 4 +--- 4 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 src/offset.rs diff --git a/Cargo.toml b/Cargo.toml index 4dad184..f89cbc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,9 @@ name = "vulkan-tutorial-ash" version = "0.1.0" authors = ["Adrien Bennadji "] -edition = "2018" +edition = "2021" build = "build.rs" +rust-version = "1.77" [dependencies] log = "0.4" diff --git a/src/main.rs b/src/main.rs index dc5fe04..b78cd34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,6 @@ mod context; mod debug; mod fs; mod math; -mod offset; mod swapchain; mod texture; mod vertex; diff --git a/src/offset.rs b/src/offset.rs deleted file mode 100644 index 4b07294..0000000 --- a/src/offset.rs +++ /dev/null @@ -1,10 +0,0 @@ -#[macro_export] -macro_rules! offset_of { - ($base:path, $field:ident) => {{ - #[allow(unused_unsafe)] - unsafe { - let b: $base = std::mem::zeroed(); - std::ptr::addr_of!(b.$field) as isize - std::ptr::addr_of!(b) as isize - } - }}; -} diff --git a/src/vertex.rs b/src/vertex.rs index fae4e78..0555396 100644 --- a/src/vertex.rs +++ b/src/vertex.rs @@ -1,7 +1,5 @@ use ash::vk; -use std::mem::size_of; - -use crate::offset_of; +use std::mem::{offset_of, size_of}; #[derive(Clone, Copy, Debug)] #[allow(dead_code)]