Skip to content

Move to using Cargo.toml [lints] #5974

Open
@Manishearth

Description

@Manishearth

This is our current lint boilerplate

#![cfg_attr(
    not(test),
    deny(
        clippy::indexing_slicing,
        clippy::unwrap_used,
        clippy::expect_used,
        clippy::panic,
        clippy::exhaustive_structs,
        clippy::exhaustive_enums,
        missing_debug_implementations,
    )
)]
#![warn(missing_docs)]

We are now on Rust 1.81, and can instead use Cargo's [lints] table, and Workspace lints, so that this can be defined in one place.

The cfg(test) matters more for the panicky lints: These can instead be covered by the Clippy allow_panic_in_tests, allow_expect_in_tests, allow_unwrap_in_tests. allow_indexing_slicing_in_tests configs. A similar config could be added to the exhaustiveness lints but we have a very small number of structs/enums in tests and we can just allow there.

cc @robertbastian @sffc

Metadata

Metadata

Assignees

Labels

C-test-infraComponent: Integration test infrastructureS-mediumSize: Less than a week (larger bug fix or enhancement)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions