2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:24:10
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
|
|
|
LL | call(foo);
|
2021-09-07 06:30:53 -05:00
|
|
|
| ---- ^^^ expected an `Fn<()>` closure, found `fn() {foo}`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `Fn<()>` is not implemented for fn item `fn() {foo}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:11:17
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call(f: impl Fn()) {
|
|
|
|
| ^^^^ required by this bound in `call`
|
2020-06-13 00:18:53 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:25:14
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
|
|
|
LL | call_mut(foo);
|
2021-09-07 06:30:53 -05:00
|
|
|
| -------- ^^^ expected an `FnMut<()>` closure, found `fn() {foo}`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `FnMut<()>` is not implemented for fn item `fn() {foo}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call_mut`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:15:21
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call_mut(f: impl FnMut()) {
|
|
|
|
| ^^^^^^^ required by this bound in `call_mut`
|
2020-06-13 00:18:53 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:26:15
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
|
|
|
LL | call_once(foo);
|
2021-09-07 06:30:53 -05:00
|
|
|
| --------- ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `FnOnce<()>` is not implemented for fn item `fn() {foo}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call_once`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:19:22
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call_once(f: impl FnOnce()) {
|
|
|
|
| ^^^^^^^^ required by this bound in `call_once`
|
2020-06-13 00:18:53 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:28:10
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
|
|
|
LL | call(foo_unsafe);
|
2022-04-05 13:13:48 -05:00
|
|
|
| ---- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
|
2021-09-07 06:30:53 -05:00
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:11:17
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call(f: impl Fn()) {
|
|
|
|
| ^^^^ required by this bound in `call`
|
2020-06-13 10:03:31 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:30:14
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
|
|
|
LL | call_mut(foo_unsafe);
|
2022-04-05 13:13:48 -05:00
|
|
|
| -------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
|
2021-09-07 06:30:53 -05:00
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call_mut`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:15:21
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call_mut(f: impl FnMut()) {
|
|
|
|
| ^^^^^^^ required by this bound in `call_mut`
|
2020-06-13 10:03:31 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:32:15
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
|
|
|
LL | call_once(foo_unsafe);
|
2022-04-05 13:13:48 -05:00
|
|
|
| --------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
|
2021-09-07 06:30:53 -05:00
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
2022-08-29 08:53:36 -05:00
|
|
|
= help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
|
2020-07-23 07:52:48 -05:00
|
|
|
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
|
2020-06-30 17:42:55 -05:00
|
|
|
= note: `#[target_feature]` functions do not implement the `Fn` traits
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `call_once`
|
2023-03-02 06:41:17 -06:00
|
|
|
--> $DIR/fn-traits.rs:19:22
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn call_once(f: impl FnOnce()) {
|
|
|
|
| ^^^^^^^^ required by this bound in `call_once`
|
2020-06-13 10:03:31 -05:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2020-06-13 00:18:53 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|