Skip to content
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

#[derive(Encode)] and friends break on structs with default generic arguments #537

Closed
bitwiseshiftleft opened this issue Apr 6, 2022 · 2 comments · Fixed by #591
Closed

Comments

@bitwiseshiftleft
Copy link

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.)

@qarmin
Copy link

qarmin commented May 1, 2022

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,
}

@VictorKoenders VictorKoenders added this to the v2.0 milestone Jun 15, 2022
@stale
Copy link

stale bot commented Aug 14, 2022

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.

@stale stale bot added the stale label Aug 14, 2022
trevyn added a commit to trevyn/bincode that referenced this issue Oct 8, 2022
trevyn added a commit to trevyn/bincode that referenced this issue Oct 8, 2022
blp added a commit to feldera/feldera that referenced this issue Jun 8, 2023
The bug in `bincode` that prevented this has now been fixed (see
bincode-org/bincode#537).

Signed-off-by: Ben Pfaff <[email protected]>
blp added a commit to feldera/feldera that referenced this issue Jun 8, 2023
The bug in `bincode` that prevented this has now been fixed (see
bincode-org/bincode#537).

Signed-off-by: Ben Pfaff <[email protected]>
blp added a commit to feldera/feldera that referenced this issue Jun 9, 2023
The bug in `bincode` that prevented this has now been fixed (see
bincode-org/bincode#537).

Signed-off-by: Ben Pfaff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants