Rust 1.72 fixes (#2302)

This commit is contained in:
Rua 2023-08-25 03:01:45 +02:00 committed by GitHub
parent 914bfa4f37
commit b3dbca4001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 17 deletions

View File

@ -1,9 +1,3 @@
[workspace]
members = [
"examples",
"vulkano",
"vulkano-macros",
"vulkano-shaders",
"vulkano-util",
"vulkano-win",
]
members = ["examples", "vulkano", "vulkano-macros", "vulkano-shaders", "vulkano-util", "vulkano-win"]
resolver = "2"

View File

@ -508,7 +508,8 @@ fn main() {
.unwrap()
};
let mut fences: Vec<Option<Arc<FenceSignalFuture<_>>>> = vec![None; framebuffers.len()];
let mut fences: Vec<Option<FenceSignalFuture<_>>> =
(0..framebuffers.len()).map(|_| None).collect();
let mut previous_fence_index = 0u32;
let start_time = SystemTime::now();
@ -566,7 +567,7 @@ fn main() {
// If the previous image has a fence then use it for synchronization, else create
// a new one.
let previous_future = match fences[previous_fence_index as usize].clone() {
let previous_future = match fences[previous_fence_index as usize].take() {
// Ensure current frame is synchronized with previous.
Some(fence) => fence.boxed(),
// Create new future to guarentee synchronization with (fake) previous frame.
@ -629,7 +630,7 @@ fn main() {
// Update this frame's future with current fence.
fences[image_index as usize] = match future.map_err(Validated::unwrap) {
// Success, store result into vector.
Ok(future) => Some(Arc::new(future)),
Ok(future) => Some(future),
// Unknown failure.
Err(e) => panic!("failed to flush future: {e}"),

View File

@ -150,7 +150,7 @@ impl VulkanoWindows {
match winit_window.set_cursor_grab(CursorGrabMode::Confined) {
Ok(_) => {}
Err(winit::error::ExternalError::NotSupported(_)) => {}
Err(err) => Err(err).unwrap(),
Err(err) => panic!("{:?}", err),
}
}

View File

@ -483,7 +483,7 @@ fn features_output(members: &[FeaturesMember]) -> TokenStream {
fn features_members(types: &HashMap<&str, (&Type, Vec<&str>)>) -> Vec<FeaturesMember> {
let mut features = HashMap::default();
std::iter::once(&types["VkPhysicalDeviceFeatures"])
.chain(sorted_structs(types).into_iter())
.chain(sorted_structs(types))
.filter(|(ty, _)| {
ty.name.as_deref() == Some("VkPhysicalDeviceFeatures")
|| ty.structextends.as_deref()

View File

@ -810,7 +810,7 @@ fn formats_members(
// cgmath only has 1, 2, 3 and 4-component vector types.
// Fall back to arrays for anything else.
if matches!(component_count, 1 | 2 | 3 | 4) {
if matches!(component_count, 1..=4) {
let ty = format_ident!("{}", format!("Vector{}", component_count));
member.type_cgmath = Some(quote! { cgmath::#ty<#component_type> });
}

View File

@ -147,7 +147,7 @@ fn properties_members(types: &HashMap<&str, (&Type, Vec<&str>)>) -> Vec<Properti
&types["VkPhysicalDeviceSparseProperties"],
]
.into_iter()
.chain(sorted_structs(types).into_iter())
.chain(sorted_structs(types))
.filter(|(ty, _)| {
let name = ty.name.as_deref();
name == Some("VkPhysicalDeviceProperties")

View File

@ -79,7 +79,6 @@
//! [the `view` module]: self::view
//! [the `shader` module documentation]: crate::shader
use self::sys::RawBuffer;
pub use self::{subbuffer::*, sys::*, usage::*};
use crate::{
device::{physical::PhysicalDevice, Device, DeviceOwned},

View File

@ -134,6 +134,7 @@
)]
// These lints are a bit too pedantic, so they're disabled here.
#![allow(
clippy::arc_with_non_send_sync,
clippy::collapsible_else_if,
clippy::collapsible_if,
clippy::derivable_impls, // TODO: remove

View File

@ -2993,5 +2993,5 @@ mod tests {
};
}
pub(self) use {dummy_allocator, dummy_info, dummy_info_linear, dummy_info_nonlinear};
use {dummy_allocator, dummy_info, dummy_info_linear, dummy_info_nonlinear};
}