]> git.proxmox.com Git - rustc.git/blame - tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / ui / rfcs / rfc-2396-target_feature-11 / fn-traits.stderr
CommitLineData
ed00b5ec 1error[E0277]: expected a `Fn()` closure, found `fn() {foo}`
f035d41b
XL
2 --> $DIR/fn-traits.rs:24:10
3 |
f035d41b 4LL | 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
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`
f035d41b 17
ed00b5ec 18error[E0277]: expected a `FnMut()` closure, found `fn() {foo}`
f035d41b
XL
19 --> $DIR/fn-traits.rs:25:14
20 |
f035d41b 21LL | 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
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`
f035d41b 34
ed00b5ec 35error[E0277]: expected a `FnOnce()` closure, found `fn() {foo}`
f035d41b
XL
36 --> $DIR/fn-traits.rs:26:15
37 |
f035d41b 38LL | 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
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`
f035d41b 51
ed00b5ec 52error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}`
f035d41b
XL
53 --> $DIR/fn-traits.rs:28:10
54 |
f035d41b 55LL | 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
64note: required by a bound in `call`
65 --> $DIR/fn-traits.rs:11:17
66 |
67LL | fn call(f: impl Fn()) {
68 | ^^^^ required by this bound in `call`
f035d41b 69
ed00b5ec 70error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}`
f035d41b
XL
71 --> $DIR/fn-traits.rs:30:14
72 |
f035d41b 73LL | 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
82note: required by a bound in `call_mut`
83 --> $DIR/fn-traits.rs:15:21
84 |
85LL | fn call_mut(f: impl FnMut()) {
86 | ^^^^^^^ required by this bound in `call_mut`
f035d41b 87
ed00b5ec 88error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}`
f035d41b
XL
89 --> $DIR/fn-traits.rs:32:15
90 |
f035d41b 91LL | 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
100note: required by a bound in `call_once`
101 --> $DIR/fn-traits.rs:19:22
102 |
103LL | fn call_once(f: impl FnOnce()) {
104 | ^^^^^^^^ required by this bound in `call_once`
f035d41b
XL
105
106error: aborting due to 6 previous errors
107
108For more information about this error, try `rustc --explain E0277`.