diff --git a/diskann-wide/Cargo.toml b/diskann-wide/Cargo.toml index a4b44efd92..0bbc83c512 100644 --- a/diskann-wide/Cargo.toml +++ b/diskann-wide/Cargo.toml @@ -8,10 +8,12 @@ license.workspace = true edition = "2024" [lints] -clippy.allow_attributes = "warn" 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 4cb1b08216..067f531fa6 100644 --- a/diskann-wide/src/lib.rs +++ b/diskann-wide/src/lib.rs @@ -195,9 +195,13 @@ 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( + 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; };