Skip to content

lint pub const _: ... #144047

@A4-Tacks

Description

@A4-Tacks

Code

pub const _: () = {
    // ...
};

Current output

empty

Desired output

warning: ...
 --> src/bin/main.rs:2:14
  |
1 | pub const _: () = {
  | ^^^
  |
  = note: `#[warn(unused_pub)]` on by default
help: remove these parentheses
  |
1 - pub const _: () = {
1 + const _: () = {
  |

Rationale and extra context

No response

Other cases

Rust Version

rustc 1.90.0-nightly (a00149764 2025-07-14)
binary: rustc
commit-hash: a001497644bc229f1abcc5b2528733386591647f
commit-date: 2025-07-14
host: aarch64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.8

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions