From d2836e9f507c470dcaa0768d4505d11ca5ec58c1 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 8 Mar 2026 05:40:17 +0000 Subject: [PATCH] Bump Rust 1.94.0. Signed-off-by: Jason Volk --- Cargo.toml | 2 +- flake.nix | 2 +- rust-toolchain.toml | 2 +- src/admin/mod.rs | 1 + src/api/mod.rs | 2 +- src/api/server/key.rs | 2 +- src/core/mod.rs | 1 + src/database/benches/ser.rs | 2 ++ src/database/mod.rs | 1 + src/database/tests.rs | 1 + src/macros/mod.rs | 2 ++ src/main/benches/main.rs | 2 ++ src/main/lib.rs | 2 +- src/main/main.rs | 2 ++ src/main/runtime.rs | 2 +- src/main/tests/smoke.rs | 1 + src/main/tests/smoke_async.rs | 1 + src/main/tests/smoke_shutdown.rs | 1 + src/router/layers.rs | 2 +- src/router/mod.rs | 2 +- src/service/benches/state_res.rs | 2 ++ src/service/mod.rs | 2 +- src/service/resolver/dns.rs | 4 ++-- src/service/rooms/event_handler/fetch_auth.rs | 8 ++++---- src/service/rooms/event_handler/handle_prev_pdu.rs | 4 ++-- src/service/rooms/retention/mod.rs | 2 +- src/service/server_keys/mod.rs | 2 +- src/service/tests/state_res/main.rs | 2 ++ 28 files changed, 39 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de131cf9..abd727dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ keywords = [ license = "Apache-2.0" readme = "README.md" repository = "https://github.com/matrix-construct/tuwunel" -rust-version = "1.91.1" +rust-version = "1.94.0" version = "1.5.1" [workspace.metadata.crane] diff --git a/flake.nix b/flake.nix index 6b5ecfe2..907d7a29 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,7 @@ file = ./rust-toolchain.toml; # See also `rust-toolchain.toml` - sha256 = "sha256-SDu4snEWjuZU475PERvu+iO50Mi39KVjqCeJeNvpguU="; + sha256 = "sha256-qqF33vNuAdU5vua96VKVIwuc43j4EFeEXbjQ6+l4mO4="; }; mkScope = diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ddce5f30..3822c015 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -9,7 +9,7 @@ # If you're having trouble making the relevant changes, bug a maintainer. [toolchain] -channel = "1.91.1" +channel = "1.94.0" profile = "minimal" components = [ # For rust-analyzer diff --git a/src/admin/mod.rs b/src/admin/mod.rs index d763c727..28ad8d95 100644 --- a/src/admin/mod.rs +++ b/src/admin/mod.rs @@ -1,4 +1,5 @@ #![expect(clippy::too_many_arguments)] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug pub(crate) mod admin; pub(crate) mod context; diff --git a/src/api/mod.rs b/src/api/mod.rs index c4bef8dc..14dca939 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1,5 +1,5 @@ #![expect(clippy::toplevel_ref_arg)] -#![expect(clippy::duration_suboptimal_units)] // remove after MSRV 1.91 +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug pub mod client; pub mod router; diff --git a/src/api/server/key.rs b/src/api/server/key.rs index 0ce7f9da..ba0aa336 100644 --- a/src/api/server/key.rs +++ b/src/api/server/key.rs @@ -61,7 +61,7 @@ pub(crate) async fn get_server_keys_route( } fn valid_until_ts() -> MilliSecondsSinceUnixEpoch { - let dur = Duration::from_secs(86400 * 7); + let dur = Duration::from_hours(168); let timepoint = timepoint_from_now(dur).expect("SystemTime should not overflow"); MilliSecondsSinceUnixEpoch::from_system_time(timepoint).expect("UInt should not overflow") } diff --git a/src/core/mod.rs b/src/core/mod.rs index ec0f559f..105d2dd1 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -1,4 +1,5 @@ #![type_length_limit = "12288"] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug pub mod alloc; pub mod config; diff --git a/src/database/benches/ser.rs b/src/database/benches/ser.rs index 7ac20fe2..996c8504 100644 --- a/src/database/benches/ser.rs +++ b/src/database/benches/ser.rs @@ -1,3 +1,5 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + use criterion::{Criterion, criterion_group, criterion_main}; criterion_group!(benches, ser_str); diff --git a/src/database/mod.rs b/src/database/mod.rs index 77da62bf..50ea6823 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -1,4 +1,5 @@ #![type_length_limit = "65536"] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug extern crate rust_rocksdb as rocksdb; diff --git a/src/database/tests.rs b/src/database/tests.rs index b289aeab..1d290735 100644 --- a/src/database/tests.rs +++ b/src/database/tests.rs @@ -1,3 +1,4 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug #![expect(clippy::needless_borrows_for_generic_args)] use std::fmt::Debug; diff --git a/src/macros/mod.rs b/src/macros/mod.rs index 97417fb7..1c3df139 100644 --- a/src/macros/mod.rs +++ b/src/macros/mod.rs @@ -1,3 +1,5 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + mod admin; mod cargo; mod config; diff --git a/src/main/benches/main.rs b/src/main/benches/main.rs index d7211caa..4e6439a8 100644 --- a/src/main/benches/main.rs +++ b/src/main/benches/main.rs @@ -1,3 +1,5 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + use criterion::{Criterion, criterion_group, criterion_main}; use tracing::Level; use tuwunel::{Args, Server, runtime}; diff --git a/src/main/lib.rs b/src/main/lib.rs index e66ad5bd..392b5d50 100644 --- a/src/main/lib.rs +++ b/src/main/lib.rs @@ -1,5 +1,5 @@ #![type_length_limit = "4096"] //TODO: reduce me -#![expect(clippy::duration_suboptimal_units)] // remove after MSRV 1.91 +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug pub mod args; pub mod logging; diff --git a/src/main/main.rs b/src/main/main.rs index 9d95e2db..b163634f 100644 --- a/src/main/main.rs +++ b/src/main/main.rs @@ -1,3 +1,5 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + use std::sync::atomic::Ordering; use tuwunel::{Server, args, restart, runtime}; diff --git a/src/main/runtime.rs b/src/main/runtime.rs index bb7ed02f..c0b2a81b 100644 --- a/src/main/runtime.rs +++ b/src/main/runtime.rs @@ -27,7 +27,7 @@ const WORKER_THREAD_MIN: usize = 2; const BLOCKING_THREAD_KEEPALIVE: u64 = 36; const BLOCKING_THREAD_NAME: &str = "tuwunel:spawned"; const BLOCKING_THREAD_MAX: usize = 1024; -const RUNTIME_SHUTDOWN_TIMEOUT: Duration = Duration::from_millis(10000); +const RUNTIME_SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(10); #[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))] const DISABLE_MUZZY_THRESHOLD: usize = 8; diff --git a/src/main/tests/smoke.rs b/src/main/tests/smoke.rs index 13f507f8..51b059a3 100644 --- a/src/main/tests/smoke.rs +++ b/src/main/tests/smoke.rs @@ -1,4 +1,5 @@ #![cfg(test)] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug use insta::{assert_debug_snapshot, with_settings}; use tuwunel::{Args, Server, runtime}; diff --git a/src/main/tests/smoke_async.rs b/src/main/tests/smoke_async.rs index 9e228005..d525743a 100644 --- a/src/main/tests/smoke_async.rs +++ b/src/main/tests/smoke_async.rs @@ -1,4 +1,5 @@ #![cfg(test)] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug use insta::{assert_debug_snapshot, with_settings}; use tuwunel::{Args, Server, runtime}; diff --git a/src/main/tests/smoke_shutdown.rs b/src/main/tests/smoke_shutdown.rs index bdb94c41..196a7d78 100644 --- a/src/main/tests/smoke_shutdown.rs +++ b/src/main/tests/smoke_shutdown.rs @@ -1,4 +1,5 @@ #![cfg(test)] +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug use insta::{assert_debug_snapshot, with_settings}; use tracing::Level; diff --git a/src/router/layers.rs b/src/router/layers.rs index 9e61e66d..17fa393f 100644 --- a/src/router/layers.rs +++ b/src/router/layers.rs @@ -181,7 +181,7 @@ fn cors_layer(server: &Server) -> CorsLayer { }; CorsLayer::new() - .max_age(Duration::from_secs(86400)) + .max_age(Duration::from_hours(24)) .allow_methods(METHODS) .allow_headers(headers) .allow_origin(allow_origin) diff --git a/src/router/mod.rs b/src/router/mod.rs index 336c1fda..b21f82ea 100644 --- a/src/router/mod.rs +++ b/src/router/mod.rs @@ -1,5 +1,5 @@ #![type_length_limit = "32768"] //TODO: reduce me -#![expect(clippy::duration_suboptimal_units)] // remove after MSRV 1.91 +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug mod handle; mod layers; diff --git a/src/service/benches/state_res.rs b/src/service/benches/state_res.rs index 66dfcd10..de9f7975 100644 --- a/src/service/benches/state_res.rs +++ b/src/service/benches/state_res.rs @@ -1,3 +1,5 @@ +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + use std::{ borrow::Borrow, collections::HashMap, diff --git a/src/service/mod.rs b/src/service/mod.rs index c21ae122..ba2d92a6 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -1,7 +1,7 @@ #![recursion_limit = "256"] #![type_length_limit = "98304"] #![expect(refining_impl_trait)] -#![expect(clippy::duration_suboptimal_units)] // remove after MSRV 1.91 +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug mod manager; mod migrations; diff --git a/src/service/resolver/dns.rs b/src/service/resolver/dns.rs index d36fd386..1917e100 100644 --- a/src/service/resolver/dns.rs +++ b/src/service/resolver/dns.rs @@ -112,8 +112,8 @@ impl Resolver { fn configure_opts(server: &Arc, mut opts: ResolverOpts) -> ResolverOpts { let config = &server.config; - opts.negative_max_ttl = Some(Duration::from_secs(60 * 60 * 24 * 30)); - opts.positive_max_ttl = Some(Duration::from_secs(60 * 60 * 24 * 7)); + opts.negative_max_ttl = Some(Duration::from_hours(720)); + opts.positive_max_ttl = Some(Duration::from_hours(168)); opts.timeout = Duration::from_secs(config.dns_timeout); opts.attempts = config.dns_attempts as usize; opts.try_tcp_on_error = config.dns_tcp_fallback; diff --git a/src/service/rooms/event_handler/fetch_auth.rs b/src/service/rooms/event_handler/fetch_auth.rs index b4449748..97b19710 100644 --- a/src/service/rooms/event_handler/fetch_auth.rs +++ b/src/service/rooms/event_handler/fetch_auth.rs @@ -66,8 +66,8 @@ where .stream() .ready_filter(|(next_id, _)| { let backed_off = self.is_backed_off(next_id, Range { - start: Duration::from_secs(5 * 60), - end: Duration::from_secs(60 * 60 * 24), + start: Duration::from_mins(5), + end: Duration::from_hours(24), }); !backed_off @@ -135,8 +135,8 @@ async fn fetch_auth_chain( } if self.is_backed_off(&next_id, Range { - start: Duration::from_secs(2 * 60), - end: Duration::from_secs(60 * 60 * 8), + start: Duration::from_mins(2), + end: Duration::from_hours(8), }) { debug_warn!("Backed off from {next_id}"); continue; diff --git a/src/service/rooms/event_handler/handle_prev_pdu.rs b/src/service/rooms/event_handler/handle_prev_pdu.rs index 5c045d29..0d117c16 100644 --- a/src/service/rooms/event_handler/handle_prev_pdu.rs +++ b/src/service/rooms/event_handler/handle_prev_pdu.rs @@ -50,8 +50,8 @@ pub(super) async fn handle_prev_pdu( } if self.is_backed_off(prev_id, Range { - start: Duration::from_secs(5 * 60), - end: Duration::from_secs(60 * 60 * 24), + start: Duration::from_mins(5), + end: Duration::from_hours(24), }) { debug!(?prev_id, "Backing off from prev_event"); return Ok(None); diff --git a/src/service/rooms/retention/mod.rs b/src/service/rooms/retention/mod.rs index 3957fd10..bd0283bb 100644 --- a/src/service/rooms/retention/mod.rs +++ b/src/service/rooms/retention/mod.rs @@ -59,7 +59,7 @@ impl crate::Service for Service { } tokio::select! { - () = tokio::time::sleep(Duration::from_secs(60 * 60)) => {}, + () = tokio::time::sleep(Duration::from_hours(1)) => {}, () = self.services.server.until_shutdown() => return Ok(()) }; } diff --git a/src/service/server_keys/mod.rs b/src/service/server_keys/mod.rs index 79f86dd5..009b5a39 100644 --- a/src/service/server_keys/mod.rs +++ b/src/service/server_keys/mod.rs @@ -41,7 +41,7 @@ pub type PubKeys = PublicKeySet; impl crate::Service for Service { fn build(args: &crate::Args<'_>) -> Result> { - let minimum_valid = Duration::from_secs(3600); + let minimum_valid = Duration::from_hours(1); let (keypair, verify_keys) = keypair::init(args.db)?; debug_assert!(verify_keys.len() == 1, "only one active verify_key supported"); diff --git a/src/service/tests/state_res/main.rs b/src/service/tests/state_res/main.rs index aa0a2957..8016f6c1 100644 --- a/src/service/tests/state_res/main.rs +++ b/src/service/tests/state_res/main.rs @@ -1,3 +1,5 @@ //! Integration tests entrypoint. +#![allow(unused_features)] // 1.96.0-nightly 2026-03-07 bug + mod resolve;