Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion diskann-wide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ license.workspace = true
edition = "2024"

[lints]
clippy.allow_attributes = "warn"
clippy.undocumented_unsafe_blocks = "warn"
clippy.uninlined_format_args = "allow"
Comment thread
hildebrandmw marked this conversation as resolved.

# different from workspace level for slightly better compatibility with the `alias!` macro.
clippy.allow_attributes = "allow"

[dev-dependencies]
paste.workspace = true
rand.workspace = true
Expand Down
18 changes: 5 additions & 13 deletions diskann-wide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> = 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) => {
Expand All @@ -207,26 +211,14 @@ macro_rules! alias {
$crate::alias!($var = <diskann_wide::arch::Current>::$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;
};
Expand Down
Loading