Skip to content

#![macro_use] is accepted at crate root #157250

@theemathas

Description

@theemathas

The following code compiles in lib.rs.

#![macro_use]

I don't know what it does (hopefully nothing), but it probably shouldn't compile.

cc @JonathanBrouwer @jdonszelmann

Meta

Reproducible on the playground with version 1.98.0-nightly (2026-05-31 14210df0e27ccd7d9e6a)

Metadata

Metadata

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions