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
Cannot derive remote serialize for #[non_exhaustive] enum #1991
Comments
I got the same issue, how to deal with it? |
I have the same issue, so I resorted to patching the remote crate for now. |
Compile error is different, but I see a similar issue on serde v1.0.184. I created a small reproduction. #[non_exhaustive]
#[derive(Serialize)]
enum E {
S(String),
} Compiling this code with rustc v1.71.1 caused the following error:
|
Fixed in serde_derive 1.0.185. I wasn't able to build use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
#[serde(remote = "std::io::ErrorKind")]
#[non_exhaustive]
pub enum ErrorKind {
NotFound,
PermissionDenied,
} |
I confirmed the fix. Thanks for the quick release. |
Attempting to use a remote derive for
gstreamer_webrtc::WebRTCSDPType
:produces the following error:
This can't be reproduced in a single-crate example, however, because
#[non_exhaustive]
isn't enforced for crate-local enums: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=084b2a4a7888fc0069d5b368e0bc6d0fThe text was updated successfully, but these errors were encountered: