Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax orderings of Serialize impl for atomic types to match the latest stable #2263

Merged
merged 1 commit into from Aug 21, 2022

Conversation

taiki-e
Copy link
Contributor

@taiki-e taiki-e commented Aug 20, 2022

The standard library changed orderings of Debug impl for atomic types from SeqCst to Relaxed in Rust 1.63 (latest stable): rust-lang/rust#97026

This PR relaxes the orderings of Serialize impl for atomic types to match the latest stable.

// Matches the atomic ordering used in libcore for the Debug impl
self.load(Ordering::SeqCst).serialize(serializer)

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 6660676 into serde-rs:master Aug 21, 2022
@taiki-e taiki-e deleted the ordering branch August 21, 2022 03:24
@Mingun
Copy link
Contributor

Mingun commented Aug 21, 2022

Shouldn't this be dependent on the current rust version?

@71
Copy link

71 commented Aug 21, 2022

@Mingun My understanding is that the reasoning for the change also applies here, ie. this change does not intend to replicate how Debug behaves, but rather applies the reasoning that Debug can use relaxed ordering to Serialize, since Debug and Serialize behave similarly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants