From 2a29479c27ce234b272f0a94b032a94a2542049d Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 1 Jul 2025 10:00:19 -0400 Subject: [PATCH 1/2] Align minimum rust version to 1.86 An issue was mentioned in https://github.com/heroku/buildpacks-deb-packages/issues/110#issuecomment-2997899858. This code was added in https://github.com/heroku-buildpacks/bullet_stream/pull/43/files and uses a feature of Rust 1.86 https://www.reddit.com/r/rust/comments/1ip51qt/trait_upcasting_stabilized_in_186/ (https://github.com/rust-lang/rust/pull/134367). This usage wasn't realized at the time. No lints or tooling caught it. That Any upcast is critical for the feature introduced in #43. The easiest path forward is to align the MSRV with the reality of the current code. Semver version bump guidance from this thread to make this a minor change: https://users.rust-lang.org/t/rust-version-requirement-change-as-semver-breaking-or-not/20980/2. --- CHANGELOG.md | 5 +++++ Cargo.lock | 2 +- Cargo.toml | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d69b93..d69e64b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,13 @@ ## Unreleased +## v0.11.0 2025/07/01 + +- Change/fix: Minimum supported Rust version is now officially 1.86. Previously released, v0.10.0, used a feature stabalized in 1.86 but did not correctly update the MSRV (https://github.com/heroku-buildpacks/bullet_stream/pull/47). + ## v0.10.0 2025/06/09 +- Change: Uses a feature of Rust not supported until 1.86, although the MSRV was not correctly incremented in this release (https://github.com/heroku-buildpacks/bullet_stream/pull/43). - Add: New function `global::with_locked_writer` is introduced to allow consistently capturing write output. This function is designed for use in testing output or in other non-reentrant capture cases. This blocks all threads using this function but one from executing so that a deterministic and consistent output is captured. Previously tests could be written with a thread_local writer, however there's a subtle race condition in that approach if the output relies on "paragraph" style text (https://github.com/heroku-buildpacks/bullet_stream/pull/43). ## v0.9.0 2025/06/05 diff --git a/Cargo.lock b/Cargo.lock index 86c2280..23dccef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ [[package]] name = "bullet_stream" -version = "0.10.0" +version = "0.11.0" dependencies = [ "ascii_table", "fun_run", diff --git a/Cargo.toml b/Cargo.toml index 88a003f..f78b1aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bullet_stream" -version = "0.10.0" +version = "0.11.0" edition = "2021" license = "MIT" description = "Bulletproof printing for bullet point text" @@ -9,6 +9,7 @@ repository = "https://github.com/schneems/bullet_stream" documentation = "https://docs.rs/bullet_stream" readme = "README.md" include = ["src/**/*", "LICENSE", "README.md"] +rust-version = "1.86" [dependencies] fun_run = { version = ">=0.5,<1", optional = true } From ad2204ffc2b906be93bc2cd77a2eaf5422a00ce8 Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 1 Jul 2025 10:16:30 -0400 Subject: [PATCH 2/2] Fix clippy lint ``` error: variables can be used directly in the `format!` string --> src/global.rs:678:9 | 678 | assert!(result.is_err(), "Expected panic to be caught {:?}", result); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-D clippy::uninlined-format-args` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 678 - assert!(result.is_err(), "Expected panic to be caught {:?}", result); 678 + assert!(result.is_err(), "Expected panic to be caught {result:?}"); | error: could not compile `bullet_stream` (lib test) due to 1 previous error ``` --- src/global.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global.rs b/src/global.rs index 038b447..f2d8c2f 100644 --- a/src/global.rs +++ b/src/global.rs @@ -675,7 +675,7 @@ mod test { .join() .expect("First thread should complete successfully"); - assert!(result.is_err(), "Expected panic to be caught {:?}", result); + assert!(result.is_err(), "Expected panic to be caught {result:?}"); let handle2 = thread::spawn(|| { let output = with_locked_writer(Vec::new(), || {