rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.45k stars 12.73k forks source link

`instruction_set` attribute can be applied to anything #128489

Open oli-obk opened 3 months ago

oli-obk commented 3 months ago

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 https://github.com/rust-lang/rust/issues/74727

see https://github.com/rust-lang/rust/pull/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.

chansuke commented 3 months ago

@rustbot claim