]>
Commit | Line | Data |
---|---|---|
f035d41b XL |
1 | // only-x86_64 |
2 | ||
3 | #![feature(target_feature_11)] | |
4 | ||
5 | #[target_feature(enable = "avx")] | |
6 | fn foo() {} | |
7 | ||
8 | #[target_feature(enable = "avx")] | |
9 | unsafe fn foo_unsafe() {} | |
10 | ||
11 | fn call(f: impl Fn()) { | |
12 | f() | |
13 | } | |
14 | ||
15 | fn call_mut(f: impl FnMut()) { | |
16 | f() | |
17 | } | |
18 | ||
19 | fn call_once(f: impl FnOnce()) { | |
20 | f() | |
21 | } | |
22 | ||
23 | fn main() { | |
1b1a35ee XL |
24 | call(foo); //~ ERROR expected a `Fn<()>` closure, found `fn() {foo}` |
25 | call_mut(foo); //~ ERROR expected a `FnMut<()>` closure, found `fn() {foo}` | |
26 | call_once(foo); //~ ERROR expected a `FnOnce<()>` closure, found `fn() {foo}` | |
f035d41b XL |
27 | |
28 | call(foo_unsafe); | |
1b1a35ee | 29 | //~^ ERROR expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b | 30 | call_mut(foo_unsafe); |
1b1a35ee | 31 | //~^ ERROR expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b | 32 | call_once(foo_unsafe); |
1b1a35ee | 33 | //~^ ERROR expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b | 34 | } |