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

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

Merged
merged 1 commit into from
May 14, 2024

Conversation

wcampbell0x2a
Copy link
Collaborator

@wcampbell0x2a wcampbell0x2a commented May 2, 2024

  • Add the following diagnostics to hopefully lead people in the right direction when seeing trait problems related to ctxs and derives
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

* Add the following diagnostics to hopefully lead people in the right direction
  when seeing trait problems related to ctxs and derives

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

* Rust Release: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html
* Rust MR: rust-lang/rust#119888
Copy link

github-actions bot commented May 2, 2024

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%

@sharksforarms sharksforarms added this to the 0.17.0 milestone May 14, 2024
@wcampbell0x2a wcampbell0x2a merged commit 75f9ecf into master May 14, 2024
7 of 13 checks passed
@wcampbell0x2a wcampbell0x2a deleted the add-new-diagnostic-attributes branch May 14, 2024 21:32
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 this pull request may close these issues.

2 participants