forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfn-traits.stderr
131 lines (123 loc) · 5.95 KB
/
fn-traits.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
error[E0277]: expected a `Fn()` closure, found `#[target_features] fn() {foo}`
--> $DIR/fn-traits.rs:29:10
|
LL | call(foo);
| ---- ^^^ expected an `Fn()` closure, found `#[target_features] fn() {foo}`
| |
| required by a bound introduced by this call
|
= help: the trait `Fn()` is not implemented for fn item `#[target_features] fn() {foo}`
= note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call`
--> $DIR/fn-traits.rs:12:17
|
LL | fn call(f: impl Fn()) {
| ^^^^ required by this bound in `call`
error[E0277]: expected a `FnMut()` closure, found `#[target_features] fn() {foo}`
--> $DIR/fn-traits.rs:30:14
|
LL | call_mut(foo);
| -------- ^^^ expected an `FnMut()` closure, found `#[target_features] fn() {foo}`
| |
| required by a bound introduced by this call
|
= help: the trait `FnMut()` is not implemented for fn item `#[target_features] fn() {foo}`
= note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call_mut`
--> $DIR/fn-traits.rs:16:25
|
LL | fn call_mut(mut f: impl FnMut()) {
| ^^^^^^^ required by this bound in `call_mut`
error[E0277]: expected a `FnOnce()` closure, found `#[target_features] fn() {foo}`
--> $DIR/fn-traits.rs:31:15
|
LL | call_once(foo);
| --------- ^^^ expected an `FnOnce()` closure, found `#[target_features] fn() {foo}`
| |
| required by a bound introduced by this call
|
= help: the trait `FnOnce()` is not implemented for fn item `#[target_features] fn() {foo}`
= note: wrap the `#[target_features] fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call_once`
--> $DIR/fn-traits.rs:20:22
|
LL | fn call_once(f: impl FnOnce()) {
| ^^^^^^^^ required by this bound in `call_once`
error[E0277]: expected a `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}`
--> $DIR/fn-traits.rs:32:19
|
LL | call_once_i32(bar);
| ------------- ^^^ expected an `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}`
| |
| required by a bound introduced by this call
|
= help: the trait `FnOnce(i32)` is not implemented for fn item `#[target_features] fn(i32) {bar}`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call_once_i32`
--> $DIR/fn-traits.rs:24:26
|
LL | fn call_once_i32(f: impl FnOnce(i32)) {
| ^^^^^^^^^^^ required by this bound in `call_once_i32`
error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:34:10
|
LL | call(foo_unsafe);
| ---- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
| |
| required by a bound introduced by this call
|
= help: the trait `Fn()` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: unsafe function cannot be called generically without an unsafe block
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call`
--> $DIR/fn-traits.rs:12:17
|
LL | fn call(f: impl Fn()) {
| ^^^^ required by this bound in `call`
error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:36:14
|
LL | call_mut(foo_unsafe);
| -------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
| |
| required by a bound introduced by this call
|
= help: the trait `FnMut()` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: unsafe function cannot be called generically without an unsafe block
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call_mut`
--> $DIR/fn-traits.rs:16:25
|
LL | fn call_mut(mut f: impl FnMut()) {
| ^^^^^^^ required by this bound in `call_mut`
error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:38:15
|
LL | call_once(foo_unsafe);
| --------- ^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
| |
| required by a bound introduced by this call
|
= help: the trait `FnOnce()` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: unsafe function cannot be called generically without an unsafe block
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
= note: try casting the function to a `fn` pointer or wrapping it in a closure
note: required by a bound in `call_once`
--> $DIR/fn-traits.rs:20:22
|
LL | fn call_once(f: impl FnOnce()) {
| ^^^^^^^^ required by this bound in `call_once`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0277`.