Skip to content

Add and apply most of rust-bitcoin's lints - #140

Open
luisschwab wants to merge 6 commits into
mit-dci:mainfrom
luisschwab:chore/add-rust-bitcoin-lints
Open

Add and apply most of rust-bitcoin's lints#140
luisschwab wants to merge 6 commits into
mit-dci:mainfrom
luisschwab:chore/add-rust-bitcoin-lints

Conversation

@luisschwab

@luisschwab luisschwab commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Changelog

- Bump `edition` to 2021 (supported since Rust 1.56.0)
- Pins `cargo-audit` and `zizmor` versions on `Cargo.toml`, such that local and CI use the same versions
- Implement `new_hash_map` and `new_hash_set` for the `std` prelude
- Add and apply all of `rust-bitcoin`'s lints, except for documentation lints, left to a follow-up
- Add the `#![no_std]` directive such that `cargo-rbmt` will also test on a no-std target
- Bump toolchains and fix `clippy::mut_mut` lint on `Stump::serialize`

@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from c2e655d to de8c93a Compare July 8, 2026 20:53
@luisschwab

luisschwab commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Added the #![no_std] directive so that cargo-rbmt will also test on a no-std target. This way we can drop the test-no-std CI job.

~$ cargo rbmt test

[...]

Tests complete.
Test Summary
Commit: de8c93a0b0bdd4864cb512bd5344a81a925cf2a2
  Package: rustreexo
    Examples           : stump_modify, stump_modify:std, stump_modify:with-serde, stump_modify:with-serde std, proof_update, proof_update:std, proof_update:with-serde, proof_update:with-serde std, custom_hash, custom_hash:std, custom_hash:with-serde, custom_hash:with-serde std
    Individual features: serde, std, with-serde
    Feature subsets    : [serde, std], [serde, with-serde], [std, with-serde]
+   No-std check       : ran

ref: https://git.rust-bitcoin.org/rust-bitcoin/rust-bitcoin-maintainer-tools/src/branch/master/cargo-rbmt#no_std

@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from 1bdc74d to 243e3cb Compare July 8, 2026 21:34
Comment thread justfile Outdated
Comment thread .github/workflows/audit.yml Outdated
Comment thread src/lib.rs
Comment thread src/pollard/mod.rs Outdated
Comment thread src/pollard/mod.rs Outdated
Comment thread src/proof/mod.rs
Comment thread src/proof/mod.rs
Comment thread src/proof/mod.rs
Comment thread Cargo.toml Outdated
Comment thread Cargo.toml Outdated
@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from 243e3cb to 425181b Compare July 17, 2026 18:52
@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from 425181b to b3b859c Compare July 27, 2026 09:02
@luisschwab

Copy link
Copy Markdown
Contributor Author

@Davidson-Souza latest reviews are addressed

@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from b3b859c to ee6851d Compare August 4, 2026 20:21
@luisschwab

Copy link
Copy Markdown
Contributor Author

ee6851d rebased on main

@Davidson-Souza

Copy link
Copy Markdown
Collaborator

Needs rebase again

@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from ee6851d to b9eaf93 Compare August 5, 2026 13:27
* Bump the Rust edition to 2021 (released on Rust 1.56.0)
* Add the `tools` field to `[package.metadata.rbmt]`, such that
  CI and local `cargo-audit` and Zizmor versions are in sync
* Update the Zizmor CI job to set up rbmt's tools
* Update the justfile and README
The `default_trait_access` lint complained that we were instantiating
a `HashMap` with `HashMap::with_hasher(Default::default())`.

I've mirrored the helpers on the `std` prelude
such that we may keep the two in sync.
Import the `std` crate, feature gated on the `std` feature,
and add the `#![no_std]` attribute such that `cargo-rbmt`
also tests the crate in a no-std target (`thumbv7m-none-eabi`).
Add and apply all `rust-bitcoin` lints, except for documentation lints.
@luisschwab
luisschwab force-pushed the chore/add-rust-bitcoin-lints branch from b9eaf93 to e29d1fe Compare August 5, 2026 13:28
@luisschwab

Copy link
Copy Markdown
Contributor Author

e29d1fe rebased on main

* Bump `stable` from 1.96.0 to 1.97.1
* Bump `nightly` from `nightly-2026-06-23` to `nightly-2026-08-04`

* Fix the `clippy::mut_mut` lint on `Stump::serialize`
@luisschwab

Copy link
Copy Markdown
Contributor Author

eaf1f5d bumped toolchains and fixed clippy::mut_mut lint on Stump::serialize

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