Skip to content

#![no_start] attribute emits false root module warning #43144

Closed
@pnkfelix

Description

@pnkfelix

(Spawned off of issue #43106)

Compiling this code (in stable/beta/nightly) results in the following compiler warnings:

#![no_start]
fn main() { }

warnings:

warning: unused attribute
 --> <anon>:1:1
  |
1 | #![no_start]
  | ^^^^^^^^^^^^
  |
  = note: #[warn(unused_attributes)] on by default

warning: crate-level attribute should be in the root module
 --> <anon>:1:1
  |
1 | #![no_start]
  | ^^^^^^^^^^^^
  |
  = note: #[warn(unused_attributes)] on by default

Similarly to #43142, the warning that a crate-level attribute should be in the root module is false here: This attribute is in the root module.


(I suspect that #[no_start], like #[crate_id="..."], is simply totally unused at this point, and our infrastructure for warning about crate-level attributes in the wrong place in the AST is somehow mistakenly coupled to the unused_attribute analysis.)

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