Skip to content

'-A unused' does not turn off warnings for unused attributes #28709

@froydnj

Description

@froydnj

Running rustc with -A unused to turn off complaints about various unused bits in code left the unused-attribute warning in place:

/usr/local/bin/rustc -O --crate-type staticlib -A unused -o libMP4Metadata.a /home/froydnj/src/gecko-dev.git/media/libstagefright/binding/MP4Metadata.rs
/home/froydnj/src/gecko-dev.git/media/libstagefright/binding/byteorder/mod.rs:39:1: 39:29 warning: unused attribute, #[warn(unused_attributes)] on by default
/home/froydnj/src/gecko-dev.git/media/libstagefright/binding/byteorder/mod.rs:39 #![crate_name = "byteorder"]
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/froydnj/src/gecko-dev.git/media/libstagefright/binding/byteorder/mod.rs:39:1: 39:29 warning: crate-level attribute should be in the root module, #[warn(unused_attributes)] on by default
/home/froydnj/src/gecko-dev.git/media/libstagefright/binding/byteorder/mod.rs:39 #![crate_name = "byteorder"]

This is documented in the -W help output, but it was surprising to me and seems inconsistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions