mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 19:01:02 +00:00
Add repro of issue 2591
error[E0507]: cannot move out of `*__self` which is behind a shared reference
--> test_suite/tests/test_remote.rs:210:10
|
210 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^
| |
| data moved here
| move occurs because `unrecognized` has type `ErrorKind`, which does not implement the `Copy` trait
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
|
210 | #[derive(&Serialize, Deserialize)]
| +
This commit is contained in:
@@ -127,7 +127,7 @@ struct Test {
|
|||||||
enum_concrete: remote::EnumGeneric<u8>,
|
enum_concrete: remote::EnumGeneric<u8>,
|
||||||
|
|
||||||
#[serde(with = "ErrorKindDef")]
|
#[serde(with = "ErrorKindDef")]
|
||||||
io_error_kind: std::io::ErrorKind,
|
io_error_kind: ErrorKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
@@ -200,8 +200,16 @@ enum EnumConcrete {
|
|||||||
Variant(u8),
|
Variant(u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum ErrorKind {
|
||||||
|
NotFound,
|
||||||
|
PermissionDenied,
|
||||||
|
#[allow(dead_code)]
|
||||||
|
ConnectionRefused,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
#[serde(remote = "std::io::ErrorKind")]
|
#[serde(remote = "ErrorKind")]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
enum ErrorKindDef {
|
enum ErrorKindDef {
|
||||||
NotFound,
|
NotFound,
|
||||||
|
|||||||
Reference in New Issue
Block a user