Remove unnecessary Send + Sync bounds from Redaction#874
Merged
max-sixty merged 1 commit intomitsuhiko:masterfrom Feb 5, 2026
Merged
Remove unnecessary Send + Sync bounds from Redaction#874max-sixty merged 1 commit intomitsuhiko:masterfrom
Send + Sync bounds from Redaction#874max-sixty merged 1 commit intomitsuhiko:masterfrom
Conversation
Follow-up to f680868 ("Don't use `Arc` in `Settings` unnecessarily"). Since `Settings` are stored in thread-local storage and wrapped in `Rc`, they can never cross thread boundaries. The `Send + Sync` bounds on `Redaction::Dynamic` and related functions were vestigial from when `Arc` was used for `DEFAULT_SETTINGS`. This relaxes the API to allow non-`Send` closures in dynamic redactions, which is now safe since those closures can never be sent to another thread. Co-Authored-By: Claude <noreply@anthropic.com>
Merged
max-sixty
added a commit
that referenced
this pull request
Mar 27, 2026
## Summary - Bump version to 1.47.0 - Update CHANGELOG ### Changes included in this release - Add `Comparator` trait for customizing how snapshot values are compared. #872 (@dstu) - Sort sequences in `sort_maps` to fix non-deterministic `HashSet` snapshots. #876 - Improve TOML serialization error message for unsupported types. #880 - Remove unnecessary `Send + Sync` bounds from `Redaction`, allowing non-`Send` closures in dynamic redactions. #874 - Don't use `Arc` in `Settings` unnecessarily. #873 (@dstu) - Upgrade `console` to 0.16 and MSRV to 1.66. #885 - Upgrade `toml-edit` to 0.25. #882 (@alexanderkjall) > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude <noreply@anthropic.com>
max-sixty
added a commit
to max-sixty/insta
that referenced
this pull request
Mar 30, 2026
The Arc→Rc change (mitsuhiko#873) and Send+Sync removal (mitsuhiko#874) were semver-breaking — they removed auto-trait impls from Settings, Redactions, Redaction, and SettingsBindDropGuard. This broke downstream crates like cedar-policy that depend on Send + Sync. Reverts to Arc and restores Send + Sync bounds on Redaction and dynamic_redaction(). Adds Send + Sync to the Comparator trait (new in 1.47.0) for compatibility. Adds a compile-time assertion to prevent future regressions. TODOs mark these as candidates for Rc in the next breaking change. Co-Authored-By: Claude <noreply@anthropic.com>
max-sixty
added a commit
that referenced
this pull request
Mar 30, 2026
The Arc→Rc change (#873) and Send+Sync removal (#874) were semver-breaking — they removed auto-trait impls from `Settings`, `Redactions`, `Redaction`, and `SettingsBindDropGuard`. This broke downstream crates like [cedar-policy](cedar-policy/cedar-spec#917) that depend on `Send + Sync`. This reverts to `Arc` and restores `Send + Sync` bounds on `Redaction` and `dynamic_redaction()`. Also adds `Send + Sync` to the `Comparator` trait (new in 1.47.0) since `Arc<ActualSettings>` requires it. A compile-time assertion prevents future regressions. TODOs mark the `Arc` usage and `Comparator` bounds as candidates for removal in the next breaking change. Thanks to @john-h-kastner-aws for reporting in #873 (comment). > _This was written by Claude Code on behalf of @max-sixty_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #873 ("Don't use
ArcinSettingsunnecessarily").Send + Syncbounds fromRedaction::DynamicvariantSend + Syncbounds fromdynamic_redaction()functionSend + Syncbounds fromSettings::add_dynamic_redaction()methodSince
Settingsare stored in thread-local storage and wrapped inRc, they can never cross thread boundaries. TheSend + Syncbounds were vestigial from whenArcwas used forDEFAULT_SETTINGS.This relaxes the API to allow non-
Sendclosures in dynamic redactions, which is now safe since those closures can never be sent to another thread.Test plan
cargo test --all-features🤖 Generated with Claude Code