From 59c89908866e6b55eea158aeae05493a3ee424d6 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 May 2026 09:30:11 -0400 Subject: [PATCH 1/5] tor-basic-utils: Update comment about std::fmt::from_fn. We now know when it was stabilized, so we can say when to use it. --- crates/tor-basic-utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tor-basic-utils/src/lib.rs b/crates/tor-basic-utils/src/lib.rs index 9093d61e42..11c672af84 100644 --- a/crates/tor-basic-utils/src/lib.rs +++ b/crates/tor-basic-utils/src/lib.rs @@ -111,7 +111,7 @@ pub fn iter_join( separator: &str, iter: impl Iterator + Clone, ) -> impl fmt::Display { - // TODO: This can be replaced with `std::fmt::from_fn()` once stabilised and within our MSRV. + // TODO MSRV 1.93: Replace with `std::fmt::from_fn()`? struct Fmt<'a, I: Iterator + Clone> { /// Separates items in `iter`. separator: &'a str, -- GitLab From be10d98832cb5ff160fddd1c4e9533c102dc0a4c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 May 2026 09:32:32 -0400 Subject: [PATCH 2/5] tor-basic-utils: remove `flatten` It is no longer needed since we require Rust 1.89. Nobody was using it. --- crates/tor-basic-utils/semver.md | 2 ++ crates/tor-basic-utils/src/lib.rs | 15 --------------- 2 files changed, 2 insertions(+), 15 deletions(-) create mode 100644 crates/tor-basic-utils/semver.md diff --git a/crates/tor-basic-utils/semver.md b/crates/tor-basic-utils/semver.md new file mode 100644 index 0000000000..1d78aafd63 --- /dev/null +++ b/crates/tor-basic-utils/semver.md @@ -0,0 +1,2 @@ +BREAKING: Removed flatten(). + diff --git a/crates/tor-basic-utils/src/lib.rs b/crates/tor-basic-utils/src/lib.rs index 11c672af84..75d6090d63 100644 --- a/crates/tor-basic-utils/src/lib.rs +++ b/crates/tor-basic-utils/src/lib.rs @@ -578,21 +578,6 @@ macro_rules! derive_serde_raw { { // ---------------------------------------------------------------------- -/// Flatten a `Result, E>` into a `Result`. -/// -/// See [`Result::flatten`], which is not available -/// at our current MSRV. -// TODO MSRV 1.89: When our MSRV is at least 1.89, -// remove this function and replace uses with `Result::flatten`. -pub fn flatten(x: Result, E>) -> Result { - match x { - Ok(Ok(x)) => Ok(x), - Err(e) | Ok(Err(e)) => Err(e), - } -} - -// ---------------------------------------------------------------------- - /// Asserts that the type of the expression implements the given trait. /// /// Example: -- GitLab From 2d4d23666853abbfaeb60cd7466df7117dc3219f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 May 2026 09:38:44 -0400 Subject: [PATCH 3/5] tor-config::derive: use cfg(true) and cfg(false) Rust 1.88 added these, so we no longer have to use `any()` for false and `all()` for true. --- crates/tor-config/src/derive.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/tor-config/src/derive.rs b/crates/tor-config/src/derive.rs index 9363643bf0..b78e43d1db 100644 --- a/crates/tor-config/src/derive.rs +++ b/crates/tor-config/src/derive.rs @@ -2506,17 +2506,15 @@ mod test { #[derive(Deftly, Clone, Debug, PartialEq)] #[derive_deftly(TorConfig)] pub(super) struct CfgEnabled { - // MSRV 1.88: Use "true" instead. #[deftly(tor_config( default, - cfg = "all()", + cfg = "true", cfg_desc = "with eschaton immenentization" ))] pub(super) flower_power: u32, - // MSRV 1.88: Use "true" instead. #[deftly(tor_config( default, - cfg = "all()", + cfg = "true", cfg_reject, cfg_desc = "with eschaton immenentization" ))] @@ -2526,16 +2524,15 @@ mod test { #[derive(Deftly, Clone, Debug, PartialEq)] #[derive_deftly(TorConfig)] pub(super) struct CfgDisabled { - // MSRV 1.88: Use "false" instead. #[deftly(tor_config( default, - cfg = "any()", + cfg = "false", cfg_desc = "with resublimated thiotimoline" ))] pub(super) time_travel: u32, #[deftly(tor_config( default, - cfg = "any()", + cfg = "false", cfg_reject, cfg_desc = "with resublimated thiotimoline" ))] -- GitLab From 0c4ed480afc9a96b37db9630c7ee3185a69fa999 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 May 2026 09:45:55 -0400 Subject: [PATCH 4/5] hsservice, llcrypto, SecurityResponse: use cfg({true,false}) --- crates/tor-hsservice/src/config.rs | 4 ++-- crates/tor-llcrypto/src/cipher.rs | 4 ++-- doc/dev/SecurityResponse.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/tor-hsservice/src/config.rs b/crates/tor-hsservice/src/config.rs index 1258c0ffa1..6eb7d856eb 100644 --- a/crates/tor-hsservice/src/config.rs +++ b/crates/tor-hsservice/src/config.rs @@ -16,9 +16,9 @@ pub mod restricted_discovery; // Only exported with pub visibility if the restricted-discovery feature is enabled. #[cfg(not(feature = "restricted-discovery"))] -// Use cfg(all()) to prevent this from being documented as +// Use cfg(true) to prevent this from being documented as // "Available on non-crate feature `restricted-discovery` only" -#[cfg_attr(docsrs, doc(cfg(all())))] +#[cfg_attr(docsrs, doc(cfg(true)))] pub(crate) mod restricted_discovery; /// Configuration for one onion service. diff --git a/crates/tor-llcrypto/src/cipher.rs b/crates/tor-llcrypto/src/cipher.rs index 66fc9d2b44..27d54503f1 100644 --- a/crates/tor-llcrypto/src/cipher.rs +++ b/crates/tor-llcrypto/src/cipher.rs @@ -7,7 +7,7 @@ /// /// These ciphers implement the `cipher::StreamCipher` trait, so use /// the [`cipher`](https://docs.rs/cipher) crate to access them. -#[cfg_attr(docsrs, doc(cfg(all())))] +#[cfg_attr(docsrs, doc(cfg(true)))] #[cfg(not(feature = "with-openssl"))] pub mod aes { // These implement StreamCipher. @@ -22,7 +22,7 @@ pub mod aes { /// /// These ciphers implement the `cipher::StreamCipher` trait, so use /// the [`cipher`](https://docs.rs/cipher) crate to access them. -#[cfg_attr(docsrs, doc(cfg(all())))] +#[cfg_attr(docsrs, doc(cfg(true)))] #[cfg(feature = "with-openssl")] pub mod aes { use cipher::generic_array::GenericArray; diff --git a/doc/dev/SecurityResponse.md b/doc/dev/SecurityResponse.md index c598801041..1f71226ac0 100644 --- a/doc/dev/SecurityResponse.md +++ b/doc/dev/SecurityResponse.md @@ -55,7 +55,7 @@ anywhere in our whole stack. and check out the tag for the version we're using. * Use cargo's `[patch]` mechanism to redirect all uses of that crate, to the one you've just checked out. - * Put `#![cfg(any())]` at the top of the affected crate's `lib.rs` + * Put `#![cfg(false)]` at the top of the affected crate's `lib.rs` and verify that that breaks the build. Now you know the `patch` is effective. * Somehow sabotage the affected method, eg by deleting or renaming it. -- GitLab From 9bb9c1eb1dc747b3ea9ca2e2209d299b3504f395 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 May 2026 09:48:51 -0400 Subject: [PATCH 5/5] proto: Remove an allow for a now-pedantic warning. --- crates/tor-proto/src/util/poll_all.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/tor-proto/src/util/poll_all.rs b/crates/tor-proto/src/util/poll_all.rs index 556d9734a0..904e7861d8 100644 --- a/crates/tor-proto/src/util/poll_all.rs +++ b/crates/tor-proto/src/util/poll_all.rs @@ -151,12 +151,6 @@ mod test { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { self.poll_count += 1; - // TODO MSRV 1.87: Remove this allow. - #[allow( - clippy::comparison_chain, - reason = "This is more readable than a match, and the lint is - moved to clippy::pedantic in 1.87." - )] if self.poll_count == self.resolve_after { Poll::Ready(self.resolve_after) } else if self.poll_count > self.resolve_after { -- GitLab