Skip to content

instruction_set attribute can be applied to anything #128489

Open
@oli-obk

Description

@oli-obk

I tried this code:

#[instruction_set(asdfasdf)]
type Foo = ();

I expected to see this happen: compilation failure because of attribute on an item where it makes no sense

Instead, this happened: compiled successfully

Meta

rustc --version --verbose:

1.80 stable

cc #74727

see #128444 for where to fix this issue, though it will be a breaking change if we hard error. That seems fine though, as the attribute is completely useless on these places.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions