Skip to content

Commit 870925d

Browse files
committed
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)] | +
1 parent d593215 commit 870925d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test_suite/tests/test_remote.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ struct Test {
127127
enum_concrete: remote::EnumGeneric<u8>,
128128

129129
#[serde(with = "ErrorKindDef")]
130-
io_error_kind: std::io::ErrorKind,
130+
io_error_kind: ErrorKind,
131131
}
132132

133133
#[derive(Serialize, Deserialize)]
@@ -200,8 +200,16 @@ enum EnumConcrete {
200200
Variant(u8),
201201
}
202202

203+
#[derive(Debug)]
204+
enum ErrorKind {
205+
NotFound,
206+
PermissionDenied,
207+
#[allow(dead_code)]
208+
ConnectionRefused,
209+
}
210+
203211
#[derive(Serialize, Deserialize)]
204-
#[serde(remote = "std::io::ErrorKind")]
212+
#[serde(remote = "ErrorKind")]
205213
#[non_exhaustive]
206214
enum ErrorKindDef {
207215
NotFound,

0 commit comments

Comments
 (0)