Skip to content

Extend metadata to items, not just crates #487

Closed
@brson

Description

@brson

Crates support attributes through the meta statement. To support conditional compilation, among other things, we want to allow attributes on all items.

Instead of using the meta statement, attributes will be applied using syntaxes like the following

#[foo]
mod bar { }
#[foo(10)]
mod bar { }
#[foo = "bar"]
mod baz { }

Maybe even something like

#[foo = "bar", baz]
mod qux { }

To support applying attributes to crates, attributes can be applied to their containing item by following them with a semicolon:

mod foo {
  #[bar];
}

Metadata

Metadata

Assignees

Labels

A-frontendArea: Compiler frontend (errors, parsing and HIR)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions