From aab228a83f1845a6f382973d3c8324c9240693fd Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 18 Nov 2023 16:49:47 +0100 Subject: [PATCH 1/3] clippy: Remove unnecessary qualification --- ash-examples/src/bin/texture.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ash-examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs index b512a22fc..42da3f751 100644 --- a/ash-examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -301,7 +301,7 @@ fn main() { .unwrap(); let mut image_slice = Align::new( image_ptr, - std::mem::align_of::() as u64, + align_of::() as u64, image_buffer_memory_req.size, ); image_slice.copy_from_slice(&image_data); From bb9e12edc6650d49f7a94a7bcdd3593ea2ea9842 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 18 Nov 2023 16:57:38 +0100 Subject: [PATCH 2/3] clippy: Replace deprecated MAX constant with one from type --- ash-examples/src/bin/texture.rs | 2 +- ash-examples/src/bin/triangle.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ash-examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs index 42da3f751..1bc4e0c2e 100644 --- a/ash-examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -689,7 +689,7 @@ fn main() { .swapchain_loader .acquire_next_image( base.swapchain, - std::u64::MAX, + u64::MAX, base.present_complete_semaphore, vk::Fence::null(), ) diff --git a/ash-examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs index ee0bcc5be..371dd67ba 100644 --- a/ash-examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -352,7 +352,7 @@ fn main() { .swapchain_loader .acquire_next_image( base.swapchain, - std::u64::MAX, + u64::MAX, base.present_complete_semaphore, vk::Fence::null(), ) From d397efc82fbea758d5b47b373a2e4152405ff9ea Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 18 Nov 2023 17:17:13 +0100 Subject: [PATCH 3/3] Move lints configuration to manifest --- Cargo.toml | 10 ++++++++++ ash-examples/Cargo.toml | 3 +++ ash-examples/src/lib.rs | 9 --------- ash-window/Cargo.toml | 3 +++ ash-window/src/lib.rs | 2 -- ash/Cargo.toml | 3 +++ ash/src/lib.rs | 8 -------- generator/Cargo.toml | 3 +++ generator/src/lib.rs | 8 -------- 9 files changed, 22 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17b22f707..f520d9e87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,13 @@ members = [ "generator", "generator-rewrite", ] + +[workspace.lints.rust] +deprecated_in_future = "warn" +rust_2018_idioms = "warn" +trivial_casts = "warn" +trivial_numeric_casts = "warn" +unused_qualifications = "warn" + +[workspace.lints.clippy] +use_self = "warn" diff --git a/ash-examples/Cargo.toml b/ash-examples/Cargo.toml index 853d7ab5e..a33682405 100644 --- a/ash-examples/Cargo.toml +++ b/ash-examples/Cargo.toml @@ -14,3 +14,6 @@ winit = "0.28.0" # directly and benefit from the infallible `Entry` constructor. ash = { path = "../ash", default-features = false, features = ["linked", "debug"] } ash-window = { path = "../ash-window" } + +[lints] +workspace = true diff --git a/ash-examples/src/lib.rs b/ash-examples/src/lib.rs index 5715ad457..44c56c37d 100644 --- a/ash-examples/src/lib.rs +++ b/ash-examples/src/lib.rs @@ -1,12 +1,3 @@ -#![warn( - clippy::use_self, - deprecated_in_future, - rust_2018_idioms, - trivial_casts, - trivial_numeric_casts, - unused_qualifications -)] - use ash::extensions::{ ext::DebugUtils, khr::{Surface, Swapchain}, diff --git a/ash-window/Cargo.toml b/ash-window/Cargo.toml index 254c8d05d..cae8d6560 100644 --- a/ash-window/Cargo.toml +++ b/ash-window/Cargo.toml @@ -32,3 +32,6 @@ ash = { path = "../ash", version = "0.37", default-features = false, features = [[example]] name = "winit" required-features = ["ash/linked"] + +[lints] +workspace = true diff --git a/ash-window/src/lib.rs b/ash-window/src/lib.rs index 7b97fb752..5cdf396fd 100644 --- a/ash-window/src/lib.rs +++ b/ash-window/src/lib.rs @@ -1,5 +1,3 @@ -#![warn(trivial_casts, trivial_numeric_casts)] - use std::os::raw::c_char; use ash::{ diff --git a/ash/Cargo.toml b/ash/Cargo.toml index 8832369c9..47eebed99 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -39,3 +39,6 @@ no-dev-version = true [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/ash/src/lib.rs b/ash/src/lib.rs index 48159327a..b3dd613c7 100644 --- a/ash/src/lib.rs +++ b/ash/src/lib.rs @@ -1,11 +1,3 @@ -#![warn( - clippy::use_self, - deprecated_in_future, - rust_2018_idioms, - trivial_casts, - trivial_numeric_casts, - unused_qualifications -)] #![allow( clippy::too_many_arguments, clippy::missing_safety_doc, diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 046fafd3d..1c0822ad8 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -20,3 +20,6 @@ vkxml = "0.3" [dependencies.syn] version = "2.0" features = ["full", "extra-traits"] + +[lints] +workspace = true diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 1d92a3539..c9ae29027 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1,12 +1,4 @@ #![recursion_limit = "256"] -#![warn( - clippy::use_self, - deprecated_in_future, - rust_2018_idioms, - trivial_casts, - trivial_numeric_casts, - unused_qualifications -)] use heck::{ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase}; use itertools::Itertools;