Skip to content

optimize attribute can be applied to anything #128488

Description

@oli-obk

I tried this code:

#![feature(optimize_attribute)]
#[optimize(cake, bar, foo, bop)]
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.82.0-nightly

2024-07-31 28a58f2fa7f0c46b8fab

cc #54882

see #128444 for where to fix this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions