rust/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
477 B
Rust
Raw Normal View History

2020-05-01 08:32:28 -05:00
// only-x86_64
#![feature(target_feature_11)]
2020-05-01 08:32:28 -05:00
trait Foo {
fn foo(&self);
unsafe fn unsf_foo(&self);
}
struct Bar;
impl Foo for Bar {
#[target_feature(enable = "sse2")]
//~^ ERROR cannot be applied to safe trait method
fn foo(&self) {}
#[target_feature(enable = "sse2")]
unsafe fn unsf_foo(&self) {}
}
trait Qux {
#[target_feature(enable = "sse2")]
//~^ ERROR cannot be applied to safe trait method
fn foo(&self) {}
}
2020-05-01 08:32:28 -05:00
fn main() {}