Skip to content

ci: Rust Lint job breaks on Rust 1.92, blocking a toolchain bump past the pinned 1.91.1 #234

Description

@mehmetkr-31

Summary

The Rust Lint CI job will fail as soon as rust-toolchain.toml is bumped past the pinned 1.91.1. On Rust 1.92, the command the job runs already fails on arc-consensus-types.

Reproduction

With a 1.92 toolchain, running the exact ci.yml lint command:

$ cargo clippy --all-targets --all-features -- -D warnings
error: unused import: `crate::codec::impl_versioned_codec`
  --> crates/types/src/codec/network.rs:26:5
error: unused import: `crate::codec::impl_versioned_codec`
  --> crates/types/src/codec/wal.rs:22:5
error: could not compile `arc-consensus-types` (lib) due to 2 previous errors

main is green today only because of the toolchain pin. Because the job runs with -D warnings, these are hard failures rather than warnings, so the toolchain bump is blocked until they are addressed.

Cause

impl_versioned_codec is a macro_rules! macro defined in crates/types/src/codec/mod.rs above the pub mod network; and pub mod wal; declarations. Textual macro scoping already puts it in scope for both child modules, so use crate::codec::impl_versioned_codec; in each of them never resolved to anything the module did not already have. Rust 1.92 is the first release whose unused_imports lint reports this.

Removing the two imports leaves the pub(crate) use impl_versioned_codec; re-export in codec/mod.rs with no remaining users, so it warns in turn — nothing outside the codec module refers to the macro by path.

Suggested fix

Delete the two use lines and the now-unused re-export: 4 lines, no behaviour change, since textual macro scoping is long-stable and resolves identically on both toolchains.

The alternative, if you would rather not touch the imports, is an #[allow(unused_imports)] — but carrying an allow for lines that do nothing seemed worse than deleting them.

Opened as #232. I do not have 1.91.1 available locally to verify there, so CI on this repo's pinned toolchain is the real check; if the macro somehow failed to resolve without the import, the build would fail loudly rather than silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions