From e918578aa9618f895b6a64d64068a33cdc850624 Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Fri, 18 Sep 2026 08:24:35 -0700 Subject: [PATCH 1/2] Fix `alias!`. --- diskann-wide/Cargo.toml | 1 - diskann-wide/src/lib.rs | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/diskann-wide/Cargo.toml b/diskann-wide/Cargo.toml index a4b44efd92..1e4a7c742b 100644 --- a/diskann-wide/Cargo.toml +++ b/diskann-wide/Cargo.toml @@ -8,7 +8,6 @@ license.workspace = true edition = "2024" [lints] -clippy.allow_attributes = "warn" clippy.undocumented_unsafe_blocks = "warn" clippy.uninlined_format_args = "allow" diff --git a/diskann-wide/src/lib.rs b/diskann-wide/src/lib.rs index 4cb1b08216..514973fb13 100644 --- a/diskann-wide/src/lib.rs +++ b/diskann-wide/src/lib.rs @@ -198,6 +198,10 @@ pub const ARCH: arch::Current = arch::current(); /// 5. `diskann_wide::alias!(f32s = type a::b::f32x4) => type f32s = a::b::f32x4`: /// Use a direct path to the type rather than reaching the type as an associated type of /// [`Architecture`]. +#[allow( + clippy::allow_attributes, + reason = "This is a publicly exported macro that may have different lints than DiskANN" +)] #[macro_export] macro_rules! alias { ($var:ident) => { @@ -207,26 +211,14 @@ macro_rules! alias { $crate::alias!($var = ::$type); }; ($var:ident = <$arch:ty>::$type:ident) => { - #[expect( - clippy::allow_attributes, - reason = "Keep allow: CamelCase aliases do not trigger the naming lint" - )] #[allow(non_camel_case_types)] type $var = <$arch as $crate::Architecture>::$type; }; ($var:ident<$arch:ident> = $type:ident) => { - #[expect( - clippy::allow_attributes, - reason = "Keep allow: CamelCase aliases do not trigger the naming lint" - )] #[allow(non_camel_case_types)] type $var<$arch> = <$arch as $crate::Architecture>::$type; }; ($var:ident = type $type:path) => { - #[expect( - clippy::allow_attributes, - reason = "Keep allow: CamelCase aliases do not trigger the naming lint" - )] #[allow(non_camel_case_types)] type $var = $type; }; From ea4e2bd59da9ae64967ccc6a62e8c8a61b28e02d Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Fri, 18 Sep 2026 08:40:24 -0700 Subject: [PATCH 2/2] Fixup docs. --- diskann-wide/Cargo.toml | 3 +++ diskann-wide/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/diskann-wide/Cargo.toml b/diskann-wide/Cargo.toml index 1e4a7c742b..0bbc83c512 100644 --- a/diskann-wide/Cargo.toml +++ b/diskann-wide/Cargo.toml @@ -11,6 +11,9 @@ edition = "2024" clippy.undocumented_unsafe_blocks = "warn" clippy.uninlined_format_args = "allow" +# different from workspace level for slightly better compatibility with the `alias!` macro. +clippy.allow_attributes = "allow" + [dev-dependencies] paste.workspace = true rand.workspace = true diff --git a/diskann-wide/src/lib.rs b/diskann-wide/src/lib.rs index 514973fb13..067f531fa6 100644 --- a/diskann-wide/src/lib.rs +++ b/diskann-wide/src/lib.rs @@ -195,7 +195,7 @@ pub const ARCH: arch::Current = arch::current(); /// ```text /// use of generic parameter from outer item /// ``` -/// 5. `diskann_wide::alias!(f32s = type a::b::f32x4) => type f32s = a::b::f32x4`: +/// 5. `diskann_wide::alias!(f32s = type a::b::f32x4) => type f32s = a::b::f32x4`: /// Use a direct path to the type rather than reaching the type as an associated type of /// [`Architecture`]. #[allow(