]>
Commit | Line | Data |
---|---|---|
ed00b5ec | 1 | error[E0277]: expected a `Fn()` closure, found `fn() {foo}` |
f035d41b XL |
2 | --> $DIR/fn-traits.rs:24:10 |
3 | | | |
f035d41b | 4 | LL | call(foo); |
ed00b5ec | 5 | | ---- ^^^ expected an `Fn()` closure, found `fn() {foo}` |
c295e0f8 XL |
6 | | | |
7 | | required by a bound introduced by this call | |
f035d41b | 8 | | |
f2b60f7d | 9 | = help: the trait `Fn<()>` is not implemented for fn item `fn() {foo}` |
3dfed10e | 10 | = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 11 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
12 | note: required by a bound in `call` |
13 | --> $DIR/fn-traits.rs:11:17 | |
14 | | | |
15 | LL | fn call(f: impl Fn()) { | |
16 | | ^^^^ required by this bound in `call` | |
f035d41b | 17 | |
ed00b5ec | 18 | error[E0277]: expected a `FnMut()` closure, found `fn() {foo}` |
f035d41b XL |
19 | --> $DIR/fn-traits.rs:25:14 |
20 | | | |
f035d41b | 21 | LL | call_mut(foo); |
ed00b5ec | 22 | | -------- ^^^ expected an `FnMut()` closure, found `fn() {foo}` |
c295e0f8 XL |
23 | | | |
24 | | required by a bound introduced by this call | |
f035d41b | 25 | | |
f2b60f7d | 26 | = help: the trait `FnMut<()>` is not implemented for fn item `fn() {foo}` |
3dfed10e | 27 | = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 28 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
29 | note: required by a bound in `call_mut` |
30 | --> $DIR/fn-traits.rs:15:21 | |
31 | | | |
32 | LL | fn call_mut(f: impl FnMut()) { | |
33 | | ^^^^^^^ required by this bound in `call_mut` | |
f035d41b | 34 | |
ed00b5ec | 35 | error[E0277]: expected a `FnOnce()` closure, found `fn() {foo}` |
f035d41b XL |
36 | --> $DIR/fn-traits.rs:26:15 |
37 | | | |
f035d41b | 38 | LL | call_once(foo); |
ed00b5ec | 39 | | --------- ^^^ expected an `FnOnce()` closure, found `fn() {foo}` |
c295e0f8 XL |
40 | | | |
41 | | required by a bound introduced by this call | |
f035d41b | 42 | | |
f2b60f7d | 43 | = help: the trait `FnOnce<()>` is not implemented for fn item `fn() {foo}` |
3dfed10e | 44 | = note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 45 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
46 | note: required by a bound in `call_once` |
47 | --> $DIR/fn-traits.rs:19:22 | |
48 | | | |
49 | LL | fn call_once(f: impl FnOnce()) { | |
50 | | ^^^^^^^^ required by this bound in `call_once` | |
f035d41b | 51 | |
ed00b5ec | 52 | error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b XL |
53 | --> $DIR/fn-traits.rs:28:10 |
54 | | | |
f035d41b | 55 | LL | call(foo_unsafe); |
04454e1e | 56 | | ---- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` |
c295e0f8 XL |
57 | | | |
58 | | required by a bound introduced by this call | |
f035d41b | 59 | | |
f2b60f7d | 60 | = help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` |
ed00b5ec | 61 | = note: unsafe function cannot be called generically without an unsafe block |
3dfed10e | 62 | = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 63 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
64 | note: required by a bound in `call` |
65 | --> $DIR/fn-traits.rs:11:17 | |
66 | | | |
67 | LL | fn call(f: impl Fn()) { | |
68 | | ^^^^ required by this bound in `call` | |
f035d41b | 69 | |
ed00b5ec | 70 | error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b XL |
71 | --> $DIR/fn-traits.rs:30:14 |
72 | | | |
f035d41b | 73 | LL | call_mut(foo_unsafe); |
04454e1e | 74 | | -------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` |
c295e0f8 XL |
75 | | | |
76 | | required by a bound introduced by this call | |
f035d41b | 77 | | |
f2b60f7d | 78 | = help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` |
ed00b5ec | 79 | = note: unsafe function cannot be called generically without an unsafe block |
3dfed10e | 80 | = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 81 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
82 | note: required by a bound in `call_mut` |
83 | --> $DIR/fn-traits.rs:15:21 | |
84 | | | |
85 | LL | fn call_mut(f: impl FnMut()) { | |
86 | | ^^^^^^^ required by this bound in `call_mut` | |
f035d41b | 87 | |
ed00b5ec | 88 | error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` |
f035d41b XL |
89 | --> $DIR/fn-traits.rs:32:15 |
90 | | | |
f035d41b | 91 | LL | call_once(foo_unsafe); |
04454e1e | 92 | | --------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }` |
c295e0f8 XL |
93 | | | |
94 | | required by a bound introduced by this call | |
f035d41b | 95 | | |
f2b60f7d | 96 | = help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` |
ed00b5ec | 97 | = note: unsafe function cannot be called generically without an unsafe block |
3dfed10e | 98 | = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` |
f035d41b | 99 | = note: `#[target_feature]` functions do not implement the `Fn` traits |
94222f64 XL |
100 | note: required by a bound in `call_once` |
101 | --> $DIR/fn-traits.rs:19:22 | |
102 | | | |
103 | LL | fn call_once(f: impl FnOnce()) { | |
104 | | ^^^^^^^^ required by this bound in `call_once` | |
f035d41b XL |
105 | |
106 | error: aborting due to 6 previous errors | |
107 | ||
108 | For more information about this error, try `rustc --explain E0277`. |