Skip to content

inner attribute syntax issue #49040

Closed
Closed
@liigo

Description

@liigo
#![allow(unused_variables)]; // note: a tailing semicolon here

fn main() {}

Stable & Nightly compiler error:

warning: this inner attribute syntax is deprecated. The new syntax is `#![foo]`, with a bang and no semicolon
 --> src/main.rs:1:1
  |
1 | #![allow(unused_variables)];
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

I think I already use the "new syntax", except adding one more semicolon.
The compiler could simply suggest me removing the redundant semicolon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions