Skip to content

New lints: #[must_use] removed #1279

@obi1kenobi

Description

@obi1kenobi

I also think I am inadvertently suggesting another lint: If a maintainer removes a must_use, in version 1.2.3 and someone writes code without removing it, that person cannot downgrade to 1.2.2 without clippy breaking. Therefore, removing a must_use would also be a minor bump.

Originally posted by @schneems in #1278

This would be in the same category as non-breaking API additions: it should be allow-by-default and opt-in.

We'll need variants of the lint for all places where #[must_use] may appear. Use the existing "#[must_use] removed" lints to guide where a corresponding removal lint should exist.

Rust 1.89 has a bug around #[must_use] that makes the attribute not appear as expected in rustdoc JSON. You'll likely need to add each new lint here to the list of exemptions for Rust 1.89 tests here Our minimum supported Rust version is 1.90+ so the 1.89 bug is no longer a concern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: new or existing lintC-enhancementCategory: raise the bar on expectationsE-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: Mentorship is available for this issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions