Skip to content

expected a type, found an import warning false positive of "disallowed-types" #14767

Closed
@ldm0

Description

@ldm0

Summary

"disallowed-types"'s false positive

Lint Name

disallowed-types

Reproducer

Minimal reproduction: https://github.com/ldm0/rust_test2

cargo clippy -p foo

I saw this happen:

warning: expected a type, found an import
 --> /Users/ldm0/repo/tmp/rust_test3/clippy.toml:2:5
  |
2 |     { path = "foo::Fooo", reason = "Noooooooooo" },
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `foo` (lib) generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s

I expected to see no warning emitted.

Version

rustc 1.88.0-nightly (cb31a009e 2025-04-27)
binary: rustc
commit-hash: cb31a009e3e735ab08613cec2d8a5a754e65596f
commit-date: 2025-04-27
host: aarch64-apple-darwin
release: 1.88.0-nightly
LLVM version: 20.1.2

Additional Labels

No response

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 have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions