Remove InvalidInternalKey variant from TaprootBuilderError#2887
Remove InvalidInternalKey variant from TaprootBuilderError#2887apoelstra merged 2 commits intorust-bitcoin:masterfrom
InvalidInternalKey variant from TaprootBuilderError#2887Conversation
This variant is unused, remove it. Done as part of rust-bitcoin#2883.
|
Side notes: what made it no longer needed? We should take a huge care to avoid these situations since after 1.0 we'll be stuck with unused variants. |
|
Yes, I'd love to have some tooling to find these unused variants but I don't know of any? |
|
I was mainly pointing at whatever caused the variant to be there in the first place - likely not great design. This is also the exact reason I suggested to hide all the errors first and only unhide them later when we're confident about what they should be. |
|
Weirdly it appears to have been introduced in #677 but never used even then. I guess it was a rebasing error of some sort. @tcharding re tooling -- one thing you can do is change all the error enums from |
|
I did the I do not know if the lack of "variant foo never constructed" warnings means that they don't exist or that clippy just stops before getting to checking unused variants? |
|
I think it means they don't exist. But yeah, it's super annoying to reduced visibility without rustc complaining these days. You might be able to use 1.56.1 and it'll compalin less while still complaining about never-constructed variats. |
|
Drats, even worse, with 1.56.1 they are errors not warnings. |
|
They're trying to prevent libraries from having broken API by having non-public items in the API. Sadly, there's no tool that I know of to prevent having a bad API by having an unneeded variant. |
|
This is pretty obnoxious, given that it's totally possible to have non-public items in your API (and this "feature" is even abused in sealing constructions etc). I'm simultaneously dealing with "non-public items in API" in BlockstreamResearch/rust-simplicity#219 while the compiler is spamming Tobin with this useless nonsense.. |
This variant is unused, remove it.
Done as part of #2883.