From 71bd61da40016a66ff440c5d578a2c254b7fc555 Mon Sep 17 00:00:00 2001 From: Bailey Hayes Date: Tue, 16 Jun 2026 10:47:46 -0400 Subject: [PATCH] fix(sqlite): silence time 0.3.48 modifier deprecations under -D warnings time 0.3.48 deprecated the field-based `modifier::{Year, Month, Hour}` format components and raw-byte `Literal`, which broke `clippy -D warnings` in CI (no Cargo.lock, so the latest `time` is resolved). The new `#[non_exhaustive]` replacements aren't const-constructible the way these `const` format items need, and the deprecated API still works, so scope an `#![allow(deprecated)]` to `mod formats` as a stopgap. Tracking for migration: #4310 Signed-off-by: Bailey Hayes --- sqlx-sqlite/src/types/time.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sqlx-sqlite/src/types/time.rs b/sqlx-sqlite/src/types/time.rs index 0e0027882d..7663e2a369 100644 --- a/sqlx-sqlite/src/types/time.rs +++ b/sqlx-sqlite/src/types/time.rs @@ -193,6 +193,15 @@ fn decode_datetime_from_text(value: &str) -> Option { } mod formats { + // `time` 0.3.48 deprecated the field-based `modifier::{Year, Month, Hour}` + // components and the raw-byte `BorrowedFormatItem::Literal` in favor of new + // `#[non_exhaustive]` components (`Year*`, `Month*`, `Hour24`, `StringLiteral`). + // Those replacements aren't `const`-constructible the way the format items + // below require, and the deprecated API still works, so suppress the lint + // here until the format builders are migrated. + // Tracking: https://github.com/transact-rs/sqlx/issues/4310 + #![allow(deprecated)] + use time::format_description::BorrowedFormatItem::{Component, Literal, Optional}; use time::format_description::{modifier, BorrowedFormatItem, Component::*};