Skip to content

Unstable target features are incorrectly reported for upstream crates #50094

Closed
@alexcrichton

Description

@alexcrichton

Given:

// foo.rs
#![feature(mmx_target_feature)]

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

and

extern crate foo;

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

you'll see:

$ rustc +nightly foo.rs --crate-type lib
$ rustc +nightly bar.rs -L .
error[E0658]: the target feature `mmx` is currently unstable
 --> /home/alex/code/rust4/foo.rs:3:18
  |
3 | #[target_feature(enable = "mmx")]
  |                  ^^^^^^^^^^^^^^
  |
  = help: add #![feature(mmx_target_feature)] to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.

But that's not right! Only the original crate should need this directive, and it indeed has such a directive.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions