Skip to content

Commit 0106667

Browse files
chore: remove std::mem::* imports now unnecessary with REPO_MSRV
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust 1.80; see [`rust`#123168](rust-lang/rust#123168).
1 parent 2088645 commit 0106667

File tree

27 files changed

+16
-40
lines changed

27 files changed

+16
-40
lines changed

examples/src/boids/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// adapted from https://github.com/austinEng/webgpu-samples/blob/master/src/examples/computeBoids.ts
33

44
use nanorand::{Rng, WyRand};
5-
use std::mem::size_of;
65
use wgpu::util::DeviceExt;
76

87
// number of boid particles to simulate

examples/src/bunnymark/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bytemuck::{Pod, Zeroable};
22
use nanorand::{Rng, WyRand};
3-
use std::{borrow::Cow, mem::size_of};
3+
use std::borrow::Cow;
44
use wgpu::util::DeviceExt;
55
use winit::{
66
event::{ElementState, KeyEvent},

examples/src/cube/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::{f32::consts, mem::size_of};
2+
use std::f32::consts;
33
use wgpu::util::DeviceExt;
44

55
#[repr(C)]

examples/src/hello_compute/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{mem::size_of_val, str::FromStr};
1+
use std::str::FromStr;
22
use wgpu::util::DeviceExt;
33

44
// Indicates a u32 overflow in an intermediate Collatz value

examples/src/hello_synchronization/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::mem::size_of_val;
2-
31
const ARR_SIZE: usize = 128;
42

53
struct ExecuteResults {

examples/src/hello_workgroups/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
//!
88
//! Only parts specific to this example will be commented.
99
10-
use std::mem::size_of_val;
11-
1210
use wgpu::util::DeviceExt;
1311

1412
async fn run() {

examples/src/mipmap/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::{f32::consts, mem::size_of};
2+
use std::f32::consts;
33
use wgpu::util::DeviceExt;
44

55
const TEXTURE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8UnormSrgb;

examples/src/msaa_line/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! * Set the primitive_topology to PrimitiveTopology::LineList.
88
//! * Vertices and Indices describe the two points that make up a line.
99
10-
use std::{iter, mem::size_of};
10+
use std::iter;
1111

1212
use bytemuck::{Pod, Zeroable};
1313
use wgpu::util::DeviceExt;

examples/src/repeated_compute/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! hello-compute example does not such as mapping buffers
66
//! and why use the async channels.
77
8-
use std::mem::size_of_val;
9-
108
const OVERFLOW: u32 = 0xffffffff;
119

1210
async fn run() {

examples/src/shadow/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{f32::consts, iter, mem::size_of, ops::Range, sync::Arc};
1+
use std::{f32::consts, iter, ops::Range, sync::Arc};
22

33
use bytemuck::{Pod, Zeroable};
44
use wgpu::util::{align_to, DeviceExt};

examples/src/skybox/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::{f32::consts, mem::size_of};
2+
use std::f32::consts;
33
use wgpu::{util::DeviceExt, AstcBlock, AstcChannel};
44

55
const IMAGE_SIZE: u32 = 256;

examples/src/srgb_blend/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::mem::size_of;
32
use wgpu::util::DeviceExt;
43

54
#[repr(C)]

examples/src/stencil_triangles/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::mem::size_of;
32
use wgpu::util::DeviceExt;
43

54
#[repr(C)]

examples/src/storage_texture/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
//! A lot of things aren't explained here via comments. See hello-compute and
1515
//! repeated-compute for code that is more thoroughly commented.
1616
17-
use std::mem::size_of_val;
18-
1917
#[cfg(not(target_arch = "wasm32"))]
2018
use crate::utils::output_image_native;
2119
#[cfg(target_arch = "wasm32")]

examples/src/texture_arrays/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use bytemuck::{Pod, Zeroable};
2-
use std::{
3-
mem::size_of,
4-
num::{NonZeroU32, NonZeroU64},
5-
};
2+
use std::num::{NonZeroU32, NonZeroU64};
63
use wgpu::util::DeviceExt;
74

85
#[repr(C)]

examples/src/timestamp_queries/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
//! The period, i.e. the unit of time, of the timestamps in wgpu is undetermined and needs to be queried with `wgpu::Queue::get_timestamp_period`
1818
//! in order to get comparable results.
1919
20-
use std::mem::size_of;
21-
2220
use wgpu::util::DeviceExt;
2321

2422
struct Queries {

examples/src/uniform_values/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! The usage of the uniform buffer within the shader itself is pretty self-explanatory given
1717
//! some understanding of WGSL.
1818
19-
use std::{mem::size_of, sync::Arc};
19+
use std::sync::Arc;
2020
// We won't bring StorageBuffer into scope as that might be too easy to confuse
2121
// with actual GPU-allocated WGPU storage buffers.
2222
use encase::ShaderType;

examples/src/water/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod point_gen;
33
use bytemuck::{Pod, Zeroable};
44
use glam::Vec3;
55
use nanorand::{Rng, WyRand};
6-
use std::{f32::consts, iter, mem::size_of};
6+
use std::{f32::consts, iter};
77
use wgpu::util::DeviceExt;
88

99
///

player/tests/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use player::GlobalPlay;
1414
use std::{
1515
fs::{read_to_string, File},
1616
io::{Read, Seek, SeekFrom},
17-
mem::size_of,
1817
path::{Path, PathBuf},
1918
slice,
2019
};

tests/tests/compute_pass_ownership.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Tests that compute passes take ownership of resources that are associated with.
22
//! I.e. once a resource is passed in to a compute pass, it can be dropped.
33
4-
use std::{mem::size_of, num::NonZeroU64};
4+
use std::num::NonZeroU64;
55

66
use wgpu::util::DeviceExt as _;
77
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};

tests/tests/occlusion_query/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::mem::size_of;
21
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters};
32

43
#[gpu_test]

tests/tests/render_pass_ownership.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! * rpass.multi_draw_indirect_count
1010
//! * rpass.multi_draw_indexed_indirect_count
1111
//!
12-
use std::{mem::size_of, num::NonZeroU64};
12+
use std::num::NonZeroU64;
1313

1414
use wgpu::util::DeviceExt as _;
1515
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};

tests/tests/subgroup_operations/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{mem::size_of, num::NonZeroU64};
1+
use std::num::NonZeroU64;
22

33
use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};
44

tests/tests/vertex_formats/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Tests that vertex formats pass through to vertex shaders accurately.
22
3-
use std::{mem::size_of_val, num::NonZeroU64};
3+
use std::num::NonZeroU64;
44

55
use wgpu::util::{BufferInitDescriptor, DeviceExt};
66

tests/tests/vertex_indices/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! We need tests for these as the backends use various schemes to work around the lack
44
//! of support for things like `gl_BaseInstance` in shaders.
55
6-
use std::{mem::size_of_val, num::NonZeroU64, ops::Range};
6+
use std::{num::NonZeroU64, ops::Range};
77

88
use itertools::Itertools;
99
use strum::IntoEnumIterator;

wgpu/src/macros.rs

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ macro_rules! vertex_attr_array {
3232

3333
#[test]
3434
fn test_vertex_attr_array() {
35-
use std::mem::size_of;
36-
3735
let attrs = vertex_attr_array![0 => Float32x2, 3 => Uint16x4];
3836
// VertexAttribute does not support PartialEq, so we cannot test directly
3937
assert_eq!(attrs.len(), 2);

wgpu/src/util/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ mod encoder;
99
mod init;
1010

1111
use std::sync::Arc;
12-
use std::{
13-
borrow::Cow,
14-
mem::{align_of, size_of},
15-
ptr::copy_nonoverlapping,
16-
};
12+
use std::{borrow::Cow, ptr::copy_nonoverlapping};
1713

1814
pub use belt::StagingBelt;
1915
pub use device::{BufferInitDescriptor, DeviceExt};

0 commit comments

Comments
 (0)