From f93d5022da10052e0df9464ebcb1d96a9c021aaa Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 27 Apr 2026 09:15:21 -0600 Subject: [PATCH] ml-dsa: fix `unreachable_pub` lint by making `Eta` pub (#1311) This lint started failing, seemingly as of Rust 1.95. Though this may not be the best solution, to get the lint to pass again this makes `Eta` pub. --- ml-dsa/src/param.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ml-dsa/src/param.rs b/ml-dsa/src/param.rs index 93d8c21..2b00bcc 100644 --- a/ml-dsa/src/param.rs +++ b/ml-dsa/src/param.rs @@ -34,14 +34,16 @@ pub(crate) type BitlenQMinusD = Diff, SpecD>; pub(crate) type Pow2DMinus1 = Shleft>; pub(crate) type Pow2DMinus1Minus1 = Diff; -/// An integer that describes a bit length to be used in sampling -#[expect(unreachable_pub)] +/// An integer that describes a bit length to be used in sampling. +#[allow(unreachable_pub, reason = "MSRV 1.85 complains")] pub trait SamplingSize: ArraySize + Len { const ETA: Eta; } +/// Range of the uniform distribution to be used in sampling. #[derive(Copy, Clone)] -pub(crate) enum Eta { +#[allow(unreachable_pub, reason = "MSRV 1.85 complains")] +pub enum Eta { Two, Four, } @@ -54,8 +56,8 @@ impl SamplingSize for U4 { const ETA: Eta = Eta::Four; } -/// An integer that describes a mask sampling size -#[expect(unreachable_pub)] +/// An integer that describes a mask sampling size. +#[allow(unreachable_pub, reason = "MSRV 1.85 complains")] pub trait MaskSamplingSize: Unsigned { type SampleSize: ArraySize;