1 error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}`
2 --> $DIR/fn-traits.rs:24:10
4 LL | fn call(f: impl Fn()) {
5 | ---- required by this bound in `call`
8 | ^^^ expected an `Fn<()>` closure, found `fn() {foo}`
10 = help: the trait `Fn<()>` is not implemented for `fn() {foo}`
11 = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
12 = note: `#[target_feature]` functions do not implement the `Fn` traits
14 error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}`
15 --> $DIR/fn-traits.rs:25:14
17 LL | fn call_mut(f: impl FnMut()) {
18 | ------- required by this bound in `call_mut`
21 | ^^^ expected an `FnMut<()>` closure, found `fn() {foo}`
23 = help: the trait `FnMut<()>` is not implemented for `fn() {foo}`
24 = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
25 = note: `#[target_feature]` functions do not implement the `Fn` traits
27 error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}`
28 --> $DIR/fn-traits.rs:26:15
30 LL | fn call_once(f: impl FnOnce()) {
31 | -------- required by this bound in `call_once`
34 | ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}`
36 = help: the trait `FnOnce<()>` is not implemented for `fn() {foo}`
37 = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
38 = note: `#[target_feature]` functions do not implement the `Fn` traits
40 error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
41 --> $DIR/fn-traits.rs:28:10
43 LL | fn call(f: impl Fn()) {
44 | ---- required by this bound in `call`
46 LL | call(foo_unsafe);
47 | ^^^^^^^^^^ expected an `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
49 = help: the trait `Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}`
50 = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
51 = note: `#[target_feature]` functions do not implement the `Fn` traits
53 error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
54 --> $DIR/fn-traits.rs:30:14
56 LL | fn call_mut(f: impl FnMut()) {
57 | ------- required by this bound in `call_mut`
59 LL | call_mut(foo_unsafe);
60 | ^^^^^^^^^^ expected an `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
62 = help: the trait `FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}`
63 = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
64 = note: `#[target_feature]` functions do not implement the `Fn` traits
66 error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
67 --> $DIR/fn-traits.rs:32:15
69 LL | fn call_once(f: impl FnOnce()) {
70 | -------- required by this bound in `call_once`
72 LL | call_once(foo_unsafe);
73 | ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
75 = help: the trait `FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}`
76 = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
77 = note: `#[target_feature]` functions do not implement the `Fn` traits
79 error: aborting due to 6 previous errors
81 For more information about this error, try `rustc --explain E0277`.