binread icon indicating copy to clipboard operation
binread copied to clipboard

Array size error BinRead macro

Open bwintertkb opened this issue 1 year ago • 1 comments

Hi,

First of all, thank you for your time reading this! I'm having an issue with the BinRead macro. I'm trying to create a simple struct,

#[derive(Debug, BinRead)]
struct Dummy {
    name: [char; 48],
}

But I get the error,

the following implementations were found:
  <[B; 0] as BinRead>
  <[B; 10] as BinRead>
  <[B; 11] as BinRead>
  <[B; 12] as BinRead>
and 29 othersrustc[E0277](https://doc.rust-lang.org/error-index.html#E0277)

Do you guys know why that might be? Or maybe how could I fix it?

Thank you in advance!

bwintertkb avatar Jul 24 '22 19:07 bwintertkb

Sorry about the delay, this repository has been superseded by binrw. The reason this error occurs is because binread was created before the stabilisation of const generics so only has concrete implementations for arrays up to size 32. Please switch to binrw (see the pinned issues).

csnover avatar Sep 14 '22 16:09 csnover