From 6b61ce4db11c76d0e97b9364bb0bf1689a1fb486 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 23 Apr 2023 00:34:20 -0400 Subject: [PATCH 1/2] Update Debug impls for cell::Ref/cell::RefMut to still show value now that they internally use `NonNull` --- src/cell.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cell.rs b/src/cell.rs index 34d716d..469cd9a 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -5,7 +5,7 @@ use core::ptr::NonNull; use std::{ cell::UnsafeCell, error::Error, - fmt::{Display, Error as FormatError, Formatter}, + fmt::{Debug, Display, Error as FormatError, Formatter}, ops::{Deref, DerefMut}, sync::atomic::{AtomicUsize, Ordering}, usize, @@ -41,7 +41,6 @@ impl Error for InvalidBorrow { /// An immutable reference to data in a `TrustCell`. /// /// Access the value via `std::ops::Deref` (e.g. `*val`) -#[derive(Debug)] pub struct Ref<'a, T: ?Sized + 'a> { flag: &'a AtomicUsize, value: NonNull, @@ -135,10 +134,15 @@ impl<'a, T: ?Sized> Clone for Ref<'a, T> { } } +impl<'a, T: ?Sized + Debug> Debug for Ref<'a, T> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FormatError> { + ::fmt(self, f) + } +} + /// A mutable reference to data in a `TrustCell`. /// /// Access the value via `std::ops::DerefMut` (e.g. `*val`) -#[derive(Debug)] pub struct RefMut<'a, T: ?Sized + 'a> { flag: &'a AtomicUsize, value: NonNull, @@ -245,6 +249,12 @@ impl<'a, T: ?Sized> Drop for RefMut<'a, T> { } } +impl<'a, T: ?Sized + Debug> Debug for RefMut<'a, T> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FormatError> { + ::fmt(self, f) + } +} + /// A custom cell container that is a `RefCell` with thread-safety. #[derive(Debug)] pub struct TrustCell { From 6b754812e304cf6c63ba0364a82a7e0e5025aaa4 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 23 Apr 2023 00:47:03 -0400 Subject: [PATCH 2/2] Increase the MSRV to 1.59.0 Note, this is still lower than the MSRV used in `specs`. I bumped this because rayon-core v1.11.0 requires this version and the CI was failing since there is no lockfile pinning this to an older rayon-core version. --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e50dd9..666ae9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - nightly - beta - stable - - 1.56.1 # MSRV + - 1.59.0 # MSRV timeout-minutes: 10 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e5e86b..78ee40d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +* Increase MSRV to 1.59.0 because of `rayon-core v1.11.0`. + ## 0.14.1 (2022-07-14) * Undo performance regression from removing `hashbrown` by using `ahash` hasher diff --git a/Cargo.toml b/Cargo.toml index 1c99a8d..a06977e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ categories = ["concurrency"] license = "MIT OR Apache-2.0" exclude = ["bors.toml", ".travis.yml"] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.59.0" [dependencies] ahash = "0.7.6"