bincode
bincode copied to clipboard
#[derive(Encode)] and friends break on structs with default generic arguments
I'm testing against 2.0.0-rc.1.
The derive macros cause syntax errors when given a struct with a default generic argument, such as:
#[derive(Encode)]
struct Foo<Bar=Baz> {}
This produces the following error:
error: Invalid rust syntax, expected ', > or an ident, got Some(Punct { ch: '=', spacing: Alone, span: #0 bytes(104880..104881) })
--> src/xxx.rs:87:15
|
87 | struct Foo<Bar=Baz> {}
(I tested this in some project, so there is an unhelpful line number.)
Same problem I have with negative numbers - error: Invalid rust syntax, expected literal, got Some(Punct { ch: '-', spacing: Alone, span: #0 bytes(20762..20763) })
#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode)]
pub enum TypeOfFile {
Unknown = -1,
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.