about summary refs log tree commit diff
path: root/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs
blob: bb1dd3b5030391505015866b657a7558056096b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//@ only-x86_64

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) {}
    //~^ ERROR method `foo` has an incompatible type for trait

    #[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) {}
}

fn main() {}