Skip to content

Lints with alphabetic names after unknown_lints are not allowed #15126

Closed as not planned
@mondeja

Description

@mondeja

Description

I've several custom lints and I'm including them from [workspace.lints.*] tables. My definition is

[workspace.lints.clippy]
print_stdout = "deny"

[workspace.lints.rust]
warnings = "warn"
unknown_lints = "allow"
# Configuration for rs-apps-lints
web_sys_reexports = "deny"   # <---- this is included now
leptos_reexports = "deny"
# Configuration for leptos-lints
leptos_print_stdout = "deny"
# Configuration for leptos-unique-ids lints
literal_as_id_attribute_value = "deny"
tt_as_id_attribute_value = "deny"

and now I've included a new lint named web_sys_reexports. When I included this lint, running cargo clippy, clippy started to show a new warning:

warning[E0602]: unknown lint: `web_sys_reexports`

Running with --verbose shows the possible problem

Running `/home/mondeja/.rustup/toolchains/nightly-2025-05-14-x86_64-unknown-linux-gnu/bin/clippy-driver /home/mondeja/.rustup/toolchains/nightly-2025-05-14-x86_64-unknown-linux-gnu/bin/rustc --crate-name simple_icons --edition=2024 libs/simple-icons/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=133 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --deny=web_sys_reexports --warn=warnings --allow=unknown_lints --deny=unexpected_cfgs --deny=tt_as_id_attribute_value '--deny=clippy::print_stdout' --deny=literal_as_id_attribute_value --deny=leptos_reexports --deny=leptos_print_stdout --check-cfg 'cfg(dylint_lib, values(any()))' --check-cfg 'cfg(docsrs,test)' ... etc

If you check the invokation, web_sys_reexports is the unique lint that comes before --allow=unknown_lints in --deny options. It looks like a problem with .pop() calls generated from an alphabetical ordered vector. All --deny should go after --allow.

--deny=web_sys_reexports --warn=warnings --allow=unknown_lints --deny=unexpected_cfgs

If I move --deny=web_sys_reexports option after --allow=unknown_lints manually invoking the command outputted by --verbose, the warning is not emited.

Version

nightly-2025-05-14

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions