]> git.lizzy.rs Git - rust.git/blob - src/test/ui/target-feature-wrong.rs
Remove licenses
[rust.git] / src / test / ui / target-feature-wrong.rs
1 // ignore-arm
2 // ignore-aarch64
3 // ignore-wasm
4 // ignore-emscripten
5 // ignore-mips
6 // ignore-mips64
7 // ignore-powerpc
8 // ignore-powerpc64
9 // ignore-powerpc64le
10 // ignore-s390x
11 // ignore-sparc
12 // ignore-sparc64
13
14 #![feature(target_feature)]
15
16 #[target_feature = "+sse2"]
17 //~^ ERROR: must be of the form
18 #[target_feature(enable = "foo")]
19 //~^ ERROR: not valid for this target
20 #[target_feature(bar)]
21 //~^ ERROR: only accepts sub-keys
22 #[target_feature(disable = "baz")]
23 //~^ ERROR: only accepts sub-keys
24 unsafe fn foo() {}
25
26 #[target_feature(enable = "sse2")]
27 //~^ ERROR: can only be applied to `unsafe` function
28 fn bar() {}
29
30 #[target_feature(enable = "sse2")]
31 //~^ ERROR: should be applied to a function
32 mod another {}
33
34 #[inline(always)]
35 //~^ ERROR: cannot use #[inline(always)]
36 #[target_feature(enable = "sse2")]
37 unsafe fn test() {}
38
39 fn main() {
40     unsafe {
41         foo();
42         bar();
43     }
44 }