Skip to content

Commit

Permalink
Fix "cannot move out of *self which is behind a shared reference"
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 21, 2023
1 parent 870925d commit 1f8c8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serde_derive/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ fn serialize_enum(params: &Parameters, variants: &[Variant], cattrs: &attr::Cont
})
.collect();

if cattrs.non_exhaustive() {
if cattrs.remote().is_some() && cattrs.non_exhaustive() {
arms.push(quote! {
unrecognized => _serde::__private::Err(_serde::ser::Error::custom(_serde::__private::ser::CannotSerializeVariant(unrecognized))),
ref unrecognized => _serde::__private::Err(_serde::ser::Error::custom(_serde::__private::ser::CannotSerializeVariant(unrecognized))),
});
}

Expand Down

0 comments on commit 1f8c8ad

Please sign in to comment.