sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.05k stars 54 forks source link

Add diagnostic::on_unimplemented attribute on rust >=1.78 #437

Closed wcampbell0x2a closed 1 month ago

wcampbell0x2a commented 1 month ago
error[E0277]: the trait bound `FieldF: deku::DekuReader<'_, _>` is not satisfied
  --> examples/example.rs:37:14
   |
37 |     field_f: FieldF,
   |              ^^^^^^ the trait `deku::DekuReader<'_, _>` is not implemented for `FieldF`
   |
   = note: implement by adding #[derive(DekuRead)] to `FieldF`
   = note: make sure the `ctx` sent into the function matches `FieldF`'s `ctx`
   = help: the following other types implement trait `deku::DekuReader<'a, Ctx>`:
             <() as deku::DekuReader<'_, Ctx>>
             <(A, B) as deku::DekuReader<'a, Ctx>>
             <(A, B, C) as deku::DekuReader<'a, Ctx>>
             <(A, B, C, D) as deku::DekuReader<'a, Ctx>>
             <(A, B, C, D, E) as deku::DekuReader<'a, Ctx>>
             <(A, B, C, D, E, F) as deku::DekuReader<'a, Ctx>>
             <(A, B, C, D, E, F, G) as deku::DekuReader<'a, Ctx>>
             <(A, B, C, D, E, F, G, H) as deku::DekuReader<'a, Ctx>>
           and 152 others
github-actions[bot] commented 1 month ago

Benchmark for 140a86b

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | deku_read_bits | 1286.8±26.22ns | 1287.4±19.33ns | +0.05% | | deku_read_byte | 5.4±0.08ns | 5.4±0.12ns | 0.00% | | deku_read_enum | 2.6±0.07ns | 2.6±0.05ns | 0.00% | | deku_read_vec | 34.6±0.48ns | 34.5±0.48ns | -0.29% | | deku_write_bits | 160.9±1.77ns | 161.5±3.14ns | +0.37% | | deku_write_byte | 22.6±0.37ns | 22.7±0.33ns | +0.44% | | deku_write_enum | **21.4±0.30ns** | 21.8±0.37ns | **+1.87%** | | deku_write_vec | 439.0±6.14ns | **431.8±5.93ns** | **-1.64%** |