You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No unused field warnings are produced on enums deriving thiserror::Error #446
The warnings generated with a regular enum are not created for a thiserror enum, making it quite hard to catch unused fields in errors. Is this expected ?
From what I can see, if it helps for debugging: thiserror version 1.0.59 did produce these warnings. However there were no way to disable them (adding #[allow(unused)] to the whole enum, or to the variant did not make the warning go away)
I have the same issue. Especially when refactoring / prototyping, I end up with error variants that I do not actually use and no easy way of finding them. While it probably makes sense to keep around error codes for released libraries in order to not break backwards compatibility, it would be great to have this configurable in some way (and to be fair #[allow(unused)] already exists for this).
Activity
[-]No unused field warnings[/-][+]No `unused field` warnings are produced on enums deriving thiserror::Error[/+]ollbx commentedon Mar 3, 2026
I have the same issue. Especially when refactoring / prototyping, I end up with error variants that I do not actually use and no easy way of finding them. While it probably makes sense to keep around error codes for released libraries in order to not break backwards compatibility, it would be great to have this configurable in some way (and to be fair
#[allow(unused)]already exists for this).feat: implement selective variable binding to fix unused_variables su…