Skip to content

Commit 68539b3

Browse files
committed
examples: Import align_of() from mem to build on on MSRV < 1.80
In #931 we worked around "unnecessary import" warnings for the `size_of(_val)()` functions being added to the prelude in Rust 1.80 while maintaining some form of MSRV back-compatibility (despite not testing the examples against this), but forgot about `align_of()`. This means the examples still build on Rust 1.80 or higher because `align_of()` is always in scope via the prelude there, but not on older compilers. Fix this by adding it to the import that's tagged to be removed when we bump all of `ash` to MSRV 1.80.
1 parent 5916329 commit 68539b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ash-examples/src/bin/texture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::error::Error;
55
use std::ffi;
66
use std::io::Cursor;
77
use std::mem;
8-
use std::mem::{size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
8+
use std::mem::{align_of, size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
99
use std::os::raw::c_void;
1010

1111
use ash::util::*;

ash-examples/src/bin/triangle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::error::Error;
55
use std::ffi;
66
use std::io::Cursor;
77
use std::mem;
8-
use std::mem::{size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
8+
use std::mem::{align_of, size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
99

1010
use ash::util::*;
1111
use ash::vk;

0 commit comments

Comments
 (0)