Skip to content

upper_case_acronyms should not suggest breaking changes to APIs #6974

Closed
@sunshowers

Description

@sunshowers

Hi there! Thanks for writing clippy and all the useful suggestions it provides :)

Unfortunately, there's one lint that I've not been happy about: this new upper_case_acronyms lint that's on by default in Rust 1.51. I'm here to complain about two separate issues:
(1) I have aesthetic issues with the suggestions it makes.
(2) The more fundamental issue -- it routinely suggests breaking changes to stable, public APIs.

For example, the code here:

https://github.com/withoutboats/camino/blob/8f8d61dc91051b8a2ed013eb2f1fc34c03403bdb/src/lib.rs#L1595-L1629

has enums that are correctly and appropriately named, and match the corresponding names in std. However, the lint complains with:

image

Issue 1: the changes it suggests are aesthetically bad. UNC in particular is widely understood in the Windows world, and renaming it to Unc looks ugly and pattern-matches in my head to "Uncle".

Issue 2: Even if you disagree about the aesthetics, the lint recommends breaking changes to a public API. A lint like this couldn't possibly be high-value enough to suggest a breaking change to an API.

Please disable this lint by default, or at least for public APIs.

Meta

  • cargo clippy -V: clippy 0.1.51 (2fd73fa 2021-03-23)
  • rustc -Vv:
rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedP-highPriority: High

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions