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