Skip to content

False positive regression for unused_crate_dependencies #147069

@robertbastian

Description

@robertbastian

In beta (1.91.0-beta.3 (24bb93c38 2025-09-10)), there is a false positive from the unused_crate_dependencies lint that does not happen on 1.90.

To reproduce:

  • clone https://github.com/unicode-org/icu4x at 292384d6a04746164faee7d660e75a5c7ca2b89c
  • RUSTFLAGS="-D unused_crate_dependencies" cargo check --all-features --manifest-path components/properties/Cargo.toml
  • RUSTFLAGS="-D unused_crate_dependencies" cargo +beta check --all-features --manifest-path components/properties/Cargo.toml
error: extern crate `icu_locale_core` is unused in crate `icu_properties`
 --> components/properties/src/lib.rs:5:1
  |
5 | //! Definitions of [Unicode Properties] and APIs for
  | ^
  |
  = help: remove the dependency or add `use icu_locale_core as _;` to the crate root
  = note: requested on the command line with `-D unused-crate-dependencies`

error: could not compile `icu_properties` (lib) due to 1 previous error

This crate is used, so it's regression, not a bug fix.

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.L-false-positiveLint: False positive (should not have fired).L-unused_crate_dependenciesLint: unused_crate_dependenciesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions