Skip to content

Incremental compilation flags #[target_feature] as an unused attribute #50095

Closed
@alexcrichton

Description

@alexcrichton

Given this code:

#[target_feature(enable = "sse2")]
unsafe fn foo() {
}

fn main() {
    unsafe { foo(); }
}

it compiles as:

$ rustc +nightly foo.rs -C incremental=tmp
$ rustc +nightly foo.rs -C incremental=tmp
warning: unused attribute
 --> foo.rs:1:1
  |
1 | #[target_feature(enable = "sse2")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
= note: #[warn(unused_attributes)] on by default

How odd!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions