diff --git a/naga/src/back/msl/mod.rs b/naga/src/back/msl/mod.rs index b9e24454e..83245d6d3 100644 --- a/naga/src/back/msl/mod.rs +++ b/naga/src/back/msl/mod.rs @@ -723,6 +723,5 @@ pub fn write_string( #[test] fn test_error_size() { - use std::mem::size_of; assert_eq!(size_of::(), 32); } diff --git a/naga/src/front/wgsl/error.rs b/naga/src/front/wgsl/error.rs index 7bdbf12d2..4af902594 100644 --- a/naga/src/front/wgsl/error.rs +++ b/naga/src/front/wgsl/error.rs @@ -17,9 +17,6 @@ use std::ops::Range; use termcolor::{ColorChoice, NoColor, StandardStream}; use thiserror::Error; -#[cfg(test)] -use std::mem::size_of; - #[derive(Clone, Debug)] pub struct ParseError { message: String, diff --git a/naga/src/non_max_u32.rs b/naga/src/non_max_u32.rs index 2ad402e49..7cb641b4e 100644 --- a/naga/src/non_max_u32.rs +++ b/naga/src/non_max_u32.rs @@ -140,6 +140,5 @@ impl<'de> serde::Deserialize<'de> for NonMaxU32 { #[test] fn size() { - use core::mem::size_of; assert_eq!(size_of::>(), size_of::()); } diff --git a/naga/src/proc/typifier.rs b/naga/src/proc/typifier.rs index 135928990..d813bc9ea 100644 --- a/naga/src/proc/typifier.rs +++ b/naga/src/proc/typifier.rs @@ -908,6 +908,5 @@ impl<'a> ResolveContext<'a> { #[test] fn test_error_size() { - use std::mem::size_of; assert_eq!(size_of::(), 32); } diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index 099446426..e192c0b99 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -85,7 +85,6 @@ use alloc::{ vec::Vec, }; use core::{ - mem::size_of, num::{NonZeroU32, NonZeroU64}, ops::Range, }; diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index d973176c6..8519e8be8 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -2,7 +2,7 @@ use thiserror::Error; use wgt::{BufferAddress, DynamicOffset}; use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec}; -use core::{fmt, mem::size_of, str}; +use core::{fmt, str}; use crate::{ binding_model::{ diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index cf14d6b4d..6d59f1b18 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1,5 +1,5 @@ use alloc::{borrow::Cow, sync::Arc, vec::Vec}; -use core::{fmt, mem::size_of, num::NonZeroU32, ops::Range, str}; +use core::{fmt, num::NonZeroU32, ops::Range, str}; use arrayvec::ArrayVec; use thiserror::Error; diff --git a/wgpu-core/src/id.rs b/wgpu-core/src/id.rs index a74b9e909..8858e1f89 100644 --- a/wgpu-core/src/id.rs +++ b/wgpu-core/src/id.rs @@ -4,7 +4,6 @@ use core::{ fmt::{self, Debug}, hash::Hash, marker::PhantomData, - mem::size_of, num::NonZeroU64, }; use wgt::WasmNotSendSync; diff --git a/wgpu-core/src/indirect_validation.rs b/wgpu-core/src/indirect_validation.rs index 8cce7614b..624ad3f9e 100644 --- a/wgpu-core/src/indirect_validation.rs +++ b/wgpu-core/src/indirect_validation.rs @@ -1,5 +1,4 @@ use alloc::{boxed::Box, format, string::ToString as _}; -use core::mem::size_of; use core::num::NonZeroU64; use thiserror::Error; diff --git a/wgpu-core/src/pipeline_cache.rs b/wgpu-core/src/pipeline_cache.rs index b206c09ea..0253163f6 100644 --- a/wgpu-core/src/pipeline_cache.rs +++ b/wgpu-core/src/pipeline_cache.rs @@ -1,5 +1,3 @@ -use core::mem::size_of; - use thiserror::Error; use wgt::AdapterInfo; diff --git a/wgpu-core/src/registry.rs b/wgpu-core/src/registry.rs index 753fb0c1e..e015eb93a 100644 --- a/wgpu-core/src/registry.rs +++ b/wgpu-core/src/registry.rs @@ -1,5 +1,4 @@ use alloc::sync::Arc; -use core::mem::size_of; use crate::{ id::Id, diff --git a/wgpu-hal/examples/halmark/main.rs b/wgpu-hal/examples/halmark/main.rs index 731d9f0f0..f7ce594d6 100644 --- a/wgpu-hal/examples/halmark/main.rs +++ b/wgpu-hal/examples/halmark/main.rs @@ -14,9 +14,7 @@ use winit::{ use std::{ borrow::{Borrow, Cow}, - iter, - mem::size_of, - ptr, + iter, ptr, time::Instant, }; diff --git a/wgpu-hal/examples/ray-traced-triangle/main.rs b/wgpu-hal/examples/ray-traced-triangle/main.rs index 730f6b111..e0083a309 100644 --- a/wgpu-hal/examples/ray-traced-triangle/main.rs +++ b/wgpu-hal/examples/ray-traced-triangle/main.rs @@ -8,9 +8,7 @@ use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; use glam::{Affine3A, Mat4, Vec3}; use std::{ borrow::{Borrow, Cow}, - iter, - mem::size_of, - ptr, + iter, ptr, time::Instant, }; use wgpu_types::Dx12BackendOptions; diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index bc5c943d8..82b62c516 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -1,11 +1,4 @@ -use std::{ - mem::{size_of, size_of_val}, - ptr, - string::String, - sync::Arc, - thread, - vec::Vec, -}; +use std::{ptr, string::String, sync::Arc, thread, vec::Vec}; use parking_lot::Mutex; use windows::{ diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index acdfcb308..8b0c66d06 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -1,7 +1,6 @@ use std::{ borrow::Cow, - ffi, - mem::{self, size_of, size_of_val}, + ffi, mem, num::NonZeroU32, ptr, slice, string::{String, ToString as _}, diff --git a/wgpu-hal/src/dx12/instance.rs b/wgpu-hal/src/dx12/instance.rs index 69f1ac786..ef02c8aca 100644 --- a/wgpu-hal/src/dx12/instance.rs +++ b/wgpu-hal/src/dx12/instance.rs @@ -1,4 +1,4 @@ -use std::{mem::size_of_val, string::String, sync::Arc, vec::Vec}; +use std::{string::String, sync::Arc, vec::Vec}; use parking_lot::RwLock; use windows::{ diff --git a/wgpu-hal/src/gles/command.rs b/wgpu-hal/src/gles/command.rs index 2bff6278f..330142eac 100644 --- a/wgpu-hal/src/gles/command.rs +++ b/wgpu-hal/src/gles/command.rs @@ -1,9 +1,5 @@ use alloc::string::String; -use core::{ - mem::{self, size_of, size_of_val}, - ops::Range, - slice, -}; +use core::{mem, ops::Range, slice}; use arrayvec::ArrayVec; diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index 73681b7b7..da7bc1c19 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -1,7 +1,7 @@ use super::{conv::is_layered_target, Command as C, PrivateCapabilities}; use alloc::sync::Arc; use arrayvec::ArrayVec; -use core::{mem::size_of, slice, sync::atomic::Ordering}; +use core::{slice, sync::atomic::Ordering}; use glow::HasContext; const DEBUG_ID: u32 = 0; diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index 71dedf194..e827561ec 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -3,7 +3,7 @@ use std::{ borrow::ToOwned as _, ffi::{c_void, CStr, CString}, - mem::{self, size_of, size_of_val, ManuallyDrop}, + mem::{self, ManuallyDrop}, os::raw::c_int, ptr, string::String, diff --git a/wgpu-hal/src/metal/command.rs b/wgpu-hal/src/metal/command.rs index 65e3fafe7..7de30feb7 100644 --- a/wgpu-hal/src/metal/command.rs +++ b/wgpu-hal/src/metal/command.rs @@ -2,7 +2,6 @@ use super::{conv, AsNative, TimestampQuerySupport}; use crate::CommandEncoder as _; use std::{ borrow::{Cow, ToOwned as _}, - mem::size_of, ops::Range, vec::Vec, }; diff --git a/wgpu-hal/src/vulkan/command.rs b/wgpu-hal/src/vulkan/command.rs index ca19d0dca..dd10c5520 100644 --- a/wgpu-hal/src/vulkan/command.rs +++ b/wgpu-hal/src/vulkan/command.rs @@ -3,11 +3,7 @@ use super::conv; use arrayvec::ArrayVec; use ash::vk; -use std::{ - mem::{self, size_of}, - ops::Range, - slice, -}; +use std::{mem, ops::Range, slice}; const ALLOCATION_GRANULARITY: u32 = 16; const DST_IMAGE_LAYOUT: vk::ImageLayout = vk::ImageLayout::TRANSFER_DST_OPTIMAL; diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index 9fce6b37e..102898584 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -2,7 +2,7 @@ use std::{ borrow::{Cow, ToOwned as _}, collections::BTreeMap, ffi::{CStr, CString}, - mem::{self, size_of, MaybeUninit}, + mem::{self, MaybeUninit}, num::NonZeroU32, ptr, slice, sync::Arc, diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 9587216de..f1f522637 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -17,7 +17,6 @@ extern crate alloc; use alloc::{string::String, vec, vec::Vec}; use core::{ hash::{Hash, Hasher}, - mem::size_of, num::NonZeroU32, ops::Range, };