Skip to content

Lints are not produced on attributes on parameters of functions without bodies #162677

Description

@JonathanBrouwer

I tried this code:

type T = fn(#[allow()] x: usize);

I expected to see this happen: An unused_attributes lint is produced on #[allow()]

Instead, this happened: No output is produced, the code compiles

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    A-diagnosticsArea: Messages for errors, warnings, and lints
    C-bugCategory: This is a bug.
    on Sep 12, 2026
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Sep 12, 2026
  3. JonathanBrouwer commented on Sep 12, 2026

    @JonathanBrouwer
    MemberAuthor

    Related to #162639

    @rustbot claim

  4. NaitikVerma6776 commented on Oct 5, 2026

    @NaitikVerma6776

    Heyy @JonathanBrouwer , can I work on this if it's okay from your side ??

  5. JonathanBrouwer commented on Oct 5, 2026

    @JonathanBrouwer
    MemberAuthor

    I'm still working on this, it's quite tough to fix.
    I actually just made a very a WIP pr for this:#162677 (comment)

  6. NaitikVerma6776 commented on Oct 5, 2026

    @NaitikVerma6776

    @JonathanBrouwer Sorry for the confusion. I saw your WIP PR for this issue. If there’s anything else I can work on or help with in the meantime, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions