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

Cannot do single subparse() #15

Closed
mkeeter opened this issue Jan 30, 2025 · 0 comments · Fixed by #16
Closed

Cannot do single subparse() #15

mkeeter opened this issue Jan 30, 2025 · 0 comments · Fixed by #16

Comments

@mkeeter
Copy link
Contributor

mkeeter commented Jan 30, 2025

This is a simplified test case, showing that we can't do a single-element subparse()

#[derive(Ingot)]
pub struct Packet {
    pub bla: u8,

    #[ingot(subparse())]
    pub next_packet: InnerPacket, // works with `Repeated<InnerPacket>`
}

#[derive(Clone, Ingot)]
pub struct InnerPacket {
    pub baaaa: u8,
}

It fails with a cryptic message:

error[E0282]: type annotations needed
  --> src/lib.rs:76:10
   |
76 | #[derive(Ingot)]
   |          ^^^^^ cannot infer type
   |
   = note: this error originates in the derive macro `Ingot` (in Nightly builds, run with -Z macro-backtrace for more info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant