From fa948d1d8092147635397923976512d8ac39ba86 Mon Sep 17 00:00:00 2001 From: RA <70325462+RAprogramm@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:18:13 +0700 Subject: [PATCH] Restore Rust 1.89 MSRV --- CHANGELOG.md | 17 +++++++++++++++++ Cargo.lock | 8 ++++---- Cargo.toml | 10 +++++----- README.md | 8 ++++---- README.ru.md | 4 ++-- masterror-derive/Cargo.toml | 4 ++-- masterror-template/Cargo.toml | 4 ++-- masterror-template/README.md | 4 ++-- src/code/app_code.rs | 2 +- src/convert.rs | 3 +++ src/convert/tonic.rs | 8 ++++---- src/lib.rs | 2 +- src/response/details.rs | 3 +++ src/response/legacy.rs | 2 ++ src/turnkey/classifier.rs | 2 +- tests/readme_sync.rs | 2 +- 16 files changed, 54 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf5f4f..5f08546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [0.24.7] - 2025-10-23 + +### Fixed +- Restored the documented MSRV of Rust 1.89 across the workspace so crates + compile on stable 1.89 again, updating metadata, READMEs and regression tests + to match. + +## [0.24.6] - 2025-10-22 + +### Fixed +- Restored `no_std` builds by importing `alloc::String` for response helpers and + the legacy constructor, keeping textual detail setters available without the + `std` feature. +- Ensured `AppCode::from_str` remains available in `no_std` mode by explicitly + bringing `ToOwned` into scope and gated the `std::io::Error` conversion example + so doctests compile without the standard library. + ## [0.24.5] - 2025-10-21 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index caabbbb..1c55e0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1806,7 +1806,7 @@ dependencies = [ [[package]] name = "masterror" -version = "0.24.5" +version = "0.24.7" dependencies = [ "actix-web", "anyhow", @@ -1818,7 +1818,7 @@ dependencies = [ "js-sys", "log", "log-mdc", - "masterror-derive 0.9.0", + "masterror-derive 0.9.1", "masterror-template", "metrics", "redis", @@ -1859,7 +1859,7 @@ dependencies = [ [[package]] name = "masterror-derive" -version = "0.9.0" +version = "0.9.1" dependencies = [ "masterror-template", "proc-macro2", @@ -1869,7 +1869,7 @@ dependencies = [ [[package]] name = "masterror-template" -version = "0.3.6" +version = "0.3.7" [[package]] name = "matchit" diff --git a/Cargo.toml b/Cargo.toml index 9ebc1dd..63eac07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "masterror" -version = "0.24.5" -rust-version = "1.90" +version = "0.24.7" +rust-version = "1.89" edition = "2024" license = "MIT OR Apache-2.0" repository = "https://github.com/RAprogramm/masterror" @@ -42,7 +42,7 @@ resolver = "3" # Defaults for members (root объявлен строками выше, потому что build.rs парсит его как строки) [workspace.package] edition = "2024" -rust-version = "1.90" +rust-version = "1.89" license = "MIT OR Apache-2.0" repository = "https://github.com/RAprogramm/masterror" readme = "README.md" @@ -76,8 +76,8 @@ tonic = ["dep:tonic", "std"] openapi = ["dep:utoipa", "std"] [workspace.dependencies] -masterror-derive = { version = "0.9.0" } -masterror-template = { version = "0.3.6" } +masterror-derive = { version = "0.9.1" } +masterror-template = { version = "0.3.7" } [dependencies] masterror-derive = { version = "0.9" } diff --git a/README.md b/README.md index e5c5538..6910cc4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Crates.io](https://img.shields.io/crates/v/masterror)](https://crates.io/crates/masterror) [![docs.rs](https://img.shields.io/docsrs/masterror)](https://docs.rs/masterror) [![Downloads](https://img.shields.io/crates/d/masterror)](https://crates.io/crates/masterror) -![MSRV](https://img.shields.io/badge/MSRV-1.90-blue) +![MSRV](https://img.shields.io/badge/MSRV-1.89-blue) ![License](https://img.shields.io/badge/License-MIT%20or%20Apache--2.0-informational) [![CI](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml?query=branch%3Amain) [![Security audit](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml/badge.svg?branch=main&label=Security%20audit)](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml?query=branch%3Amain) @@ -74,9 +74,9 @@ The build script keeps the full feature snippet below in sync with ~~~toml [dependencies] -masterror = { version = "0.24.5", default-features = false } +masterror = { version = "0.24.7", default-features = false } # or with features: -# masterror = { version = "0.24.5", features = [ +# masterror = { version = "0.24.7", features = [ # "std", "axum", "actix", "openapi", # "serde_json", "tracing", "metrics", "backtrace", # "sqlx", "sqlx-migrate", "reqwest", "redis", @@ -445,4 +445,4 @@ assert_eq!(problem.grpc.expect("grpc").name, "UNAUTHENTICATED"); --- -MSRV: **1.90** · License: **MIT OR Apache-2.0** · No `unsafe` +MSRV: **1.89** · License: **MIT OR Apache-2.0** · No `unsafe` diff --git a/README.ru.md b/README.ru.md index a301b06..8a62664 100644 --- a/README.ru.md +++ b/README.ru.md @@ -5,7 +5,7 @@ [![Crates.io](https://img.shields.io/crates/v/masterror)](https://crates.io/crates/masterror) [![docs.rs](https://img.shields.io/docsrs/masterror)](https://docs.rs/masterror) [![Downloads](https://img.shields.io/crates/d/masterror)](https://crates.io/crates/masterror) -![MSRV](https://img.shields.io/badge/MSRV-1.90-blue) +![MSRV](https://img.shields.io/badge/MSRV-1.89-blue) ![License](https://img.shields.io/badge/License-MIT%20or%20Apache--2.0-informational) [![CI](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml?query=branch%3Amain) [![Security audit](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml/badge.svg?branch=main&label=Security%20audit)](https://github.com/RAprogramm/masterror/actions/workflows/ci.yml?query=branch%3Amain) @@ -364,4 +364,4 @@ assert_eq!(problem.grpc.expect("grpc").name, "UNAUTHENTICATED"); --- -MSRV: **1.90** · Лицензия: **MIT OR Apache-2.0** · Без `unsafe` +MSRV: **1.89** · Лицензия: **MIT OR Apache-2.0** · Без `unsafe` diff --git a/masterror-derive/Cargo.toml b/masterror-derive/Cargo.toml index b757e0b..127262e 100644 --- a/masterror-derive/Cargo.toml +++ b/masterror-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "masterror-derive" -rust-version = "1.90" -version = "0.9.0" +rust-version = "1.89" +version = "0.9.1" edition = "2024" license = "MIT OR Apache-2.0" repository = "https://github.com/RAprogramm/masterror" diff --git a/masterror-template/Cargo.toml b/masterror-template/Cargo.toml index 7ceec57..8b5ffeb 100644 --- a/masterror-template/Cargo.toml +++ b/masterror-template/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "masterror-template" -version = "0.3.6" -rust-version = "1.90" +version = "0.3.7" +rust-version = "1.89" edition = "2024" repository = "https://github.com/RAprogramm/masterror" readme = "README.md" diff --git a/masterror-template/README.md b/masterror-template/README.md index e1c15ff..e1f7227 100644 --- a/masterror-template/README.md +++ b/masterror-template/README.md @@ -10,10 +10,10 @@ Add the crate alongside `masterror` if you need direct access to the parser: ```toml [dependencies] -masterror-template = { version = "0.3.6" } +masterror-template = { version = "0.3.7" } ``` -`masterror-template` targets Rust 1.90 and builds on stable and nightly toolchains alike. +`masterror-template` targets Rust 1.89 and builds on stable and nightly toolchains alike. ## Parsing templates diff --git a/src/code/app_code.rs b/src/code/app_code.rs index 280d545..5971a3f 100644 --- a/src/code/app_code.rs +++ b/src/code/app_code.rs @@ -1,4 +1,4 @@ -use alloc::{boxed::Box, string::String}; +use alloc::{borrow::ToOwned, boxed::Box, string::String}; use core::{ error::Error as CoreError, fmt::{self, Display}, diff --git a/src/convert.rs b/src/convert.rs index 3915860..374b66a 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -44,6 +44,8 @@ //! `std::io::Error` mapping: //! //! ```rust +//! # #[cfg(feature = "std")] +//! # { //! use std::io::{self, ErrorKind}; //! //! use masterror::{AppError, AppErrorKind, AppResult}; @@ -55,6 +57,7 @@ //! //! let err = open().unwrap_err(); //! assert!(matches!(err.kind, AppErrorKind::Internal)); +//! # } //! ``` //! //! `String` mapping (useful for ad-hoc validation without the `validator` diff --git a/src/convert/tonic.rs b/src/convert/tonic.rs index c9cb656..f36e5c9 100644 --- a/src/convert/tonic.rs +++ b/src/convert/tonic.rs @@ -37,10 +37,10 @@ use crate::{ /// Error alias retained for backwards compatibility with 0.20 conversions. /// -/// Since Rust 1.90 the standard library implements [`TryFrom`] for every -/// [`Into`] conversion with [`core::convert::Infallible`] as the error type. -/// Tonic conversions are therefore guaranteed to succeed, and this alias keeps -/// the historic [`StatusConversionError`] name available for downstream APIs. +/// The standard library implements [`TryFrom`] for every [`Into`] conversion +/// with [`core::convert::Infallible`] as the error type, so tonic conversions +/// are guaranteed to succeed. This alias keeps the historic +/// [`StatusConversionError`] name available for downstream APIs. /// /// # Examples /// ```rust,ignore diff --git a/src/lib.rs b/src/lib.rs index 83fbd13..23b2e5e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ //! //! # Minimum Supported Rust Version (MSRV) //! -//! MSRV is **1.90**. New minor releases may increase MSRV with a changelog +//! MSRV is **1.89**. New minor releases may increase MSRV with a changelog //! note, but never in a patch release. //! //! # Feature flags diff --git a/src/response/details.rs b/src/response/details.rs index f1a05c4..7a9b0f8 100644 --- a/src/response/details.rs +++ b/src/response/details.rs @@ -1,3 +1,6 @@ +#[cfg(not(feature = "serde_json"))] +use alloc::string::String; + #[cfg(feature = "serde_json")] use serde::Serialize; #[cfg(feature = "serde_json")] diff --git a/src/response/legacy.rs b/src/response/legacy.rs index 217e6fd..ce9e3e7 100644 --- a/src/response/legacy.rs +++ b/src/response/legacy.rs @@ -1,3 +1,5 @@ +use alloc::string::String; + use http::StatusCode; use super::core::ErrorResponse; diff --git a/src/turnkey/classifier.rs b/src/turnkey/classifier.rs index 97e06d2..3cda78c 100644 --- a/src/turnkey/classifier.rs +++ b/src/turnkey/classifier.rs @@ -193,7 +193,7 @@ const fn is_ascii_alphanumeric(byte: u8) -> bool { /// Converts ASCII letters to lowercase and leaves other bytes unchanged. #[inline] const fn ascii_lower(b: u8) -> u8 { - // ASCII-only fold without RangeInclusive to keep const-friendly on MSRV 1.90 + // ASCII-only fold without RangeInclusive to keep const-friendly on MSRV 1.89 if b >= b'A' && b <= b'Z' { b + 32 } else { b } } diff --git a/tests/readme_sync.rs b/tests/readme_sync.rs index 9aae4e0..3117d2a 100644 --- a/tests/readme_sync.rs +++ b/tests/readme_sync.rs @@ -8,7 +8,7 @@ use tempfile::tempdir; const MINIMAL_MANIFEST: &str = r#"[package] name = "demo" version = "1.2.3" -rust-version = "1.90" +rust-version = "1.89" edition = "2024" [features]