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

Fix a bunch of clippy lints and get CI working again #89

Merged
merged 11 commits into from
Aug 9, 2024

Conversation

apoelstra
Copy link
Member

Probably needs #88 to go in in parallel.

This will result in the rendered numbering being different from the
numbering in the source code, but that's probably better than the
existing situation where the "3b" item does not show up as an
independent list item.

There's no good way I can see to fix this because of limitations of
rustfmt's list facilities. And anyway this is legacy code. So just do
something that makes clippy happy.
The Concrete impl used a weird complier gitch `let pred = |x| pred(x)`
to avoid an infinite recursion bug (which in turn triggered a compiler
bug that they didn't fix even though I filed it a DAY AFTER IT WAS
INTRODUCED ON NIGHTLY and instead they waited 3 months and released it
on stable forcing me to backport a workaround to a gazillion versions of
rust-miniscript).

The bug was rust-lang/rust#110475 BTW, just to
make sure this commit triggers another notification on that issue.

Clippy doesn't like this. Clippy is obviously wrong but rather than
having this stupid fight again just switch to a different idiom.

Meanwhile, the Semantic impl of ForEachKey panics iff any keys are
present, regardless of the closure passed to it. This is funny but
completely useless and we should just remove it.
We should really move to a system of lockfiles (and more generally move
to the rust-bitcoin-maintainer-tools set of scripts since the existing
scripts are badly broken -- a "fuzz" job that sets an unused DO_LINT
variable and never fuzzes; a  DO_FMT flag in contrib/test.sh which is
never set, etc) but this is an easy fix for now.
This is just copied from rust-bitcoin
@apoelstra
Copy link
Member Author

Ok, the CI failure is a real fuzz failure. It is saying that we need to backport rust-bitcoin/rust-miniscript#569 (which checks that descriptors have only valid characters when parsing, instead of doing this check in the middle of Display where it is too late and causes a panic in .to_string).

But I think we should deal with that later since this PR and #88 are already pretty big and we don't want too much happening at once.

Ready for review.

@RCasatta
Copy link
Collaborator

RCasatta commented Aug 9, 2024

utACK e151a85

thanks for this little tedious but very important work

@apoelstra apoelstra merged commit 1918c57 into ElementsProject:master Aug 9, 2024
16 of 17 checks passed
@apoelstra apoelstra deleted the 2024-08--lints branch August 9, 2024 14:03
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