binrw icon indicating copy to clipboard operation
binrw copied to clipboard

Error diagnostic span bug megathread

Open jam1garner opened this issue 2 years ago • 0 comments

Alright, you've all seen this before:

  |
3 | #[derive(BinWrite { .. })]
  |                   ++++++

rustc thinks some code binrw generates is causing an error due to some type or something incorrect in your attribute code. Very inconvenient! In order to fix this we need to use quote_spanned! a lot, in order to forcefully make rustc point to the right code.

This is, of course, a sisyphean task. In order to better handle this we're going to keep track of it in a checklist here! Just comment to get a new problem added, with any additional details you want to give.

The list:

  • [ ] pad_size_to incorrect type (see #30)
  • [ ] BinRead not implemented for a field (see #30)

This thread replaces #30

jam1garner avatar Oct 02 '21 03:10 jam1garner