Skip to content

Commit

Permalink
examples: Import align_of() from mem to build on on MSRV < 1.80 (#…
Browse files Browse the repository at this point in the history
…955)

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.
  • Loading branch information
MarijnS95 authored Oct 16, 2024
1 parent 5916329 commit bbd8288
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ash-examples/src/bin/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::error::Error;
use std::ffi;
use std::io::Cursor;
use std::mem;
use std::mem::{size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
use std::mem::{align_of, size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
use std::os::raw::c_void;

use ash::util::*;
Expand Down
2 changes: 1 addition & 1 deletion ash-examples/src/bin/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::error::Error;
use std::ffi;
use std::io::Cursor;
use std::mem;
use std::mem::{size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80
use std::mem::{align_of, size_of, size_of_val}; // TODO: Remove when bumping MSRV to 1.80

use ash::util::*;
use ash::vk;
Expand Down

0 comments on commit bbd8288

Please sign in to comment.