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

Rearrange parts of attr.rs that rustfmt has been refusing to format #2396

Merged
merged 1 commit into from Mar 10, 2023

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Mar 10, 2023

Affected by this old rustfmt problem: rust-lang/rustfmt#3863

Currently on master, this is clearly not rustfmt-compatible formatting:

syn::Fields::Unnamed(_) | syn::Fields::Unit => {
cx.error_spanned_by(
fields,
"#[serde(tag = \"...\")] can only be used on enums and structs with named fields",
);
}

Neither is this:

syn::Data::Enum(syn::DataEnum { enum_token, .. }) => cx
.error_spanned_by(
enum_token,
"#[serde(default = \"...\")] can only be used on structs with named fields",
),

@dtolnay dtolnay merged commit 0e70f59 into serde-rs:master Mar 10, 2023
19 checks passed
@dtolnay dtolnay deleted the msg branch March 10, 2023 04:29
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

1 participant