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