@@ -6,8 +6,10 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
6
6
...
7
7
LL | o_closure.closure();
8
8
| ^^^^^^^ field, not a method
9
+ help: to call the function stored in `closure`, surround the field access with parentheses
9
10
|
10
- = help: use `(o_closure.closure)(...)` if you meant to call the function stored in the `closure` field
11
+ LL | (o_closure.closure)();
12
+ | ^ ^
11
13
12
14
error[E0599]: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:39:36: 39:41]>` in the current scope
13
15
--> $DIR/issue-2392.rs:42:15
@@ -16,9 +18,9 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
16
18
| -------------------------------------- method `not_closure` not found for this
17
19
...
18
20
LL | o_closure.not_closure();
19
- | ^^^^^^^^^^^ field, not a method
20
- |
21
- = help: did you mean to write `o_closure.not_closure` instead of `o_closure.not_closure(...)`?
21
+ | ^^^^^^^^^^^-- help: remove the arguments
22
+ | |
23
+ | field, not a method
22
24
23
25
error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
24
26
--> $DIR/issue-2392.rs:46:12
@@ -28,8 +30,10 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
28
30
...
29
31
LL | o_func.closure();
30
32
| ^^^^^^^ field, not a method
33
+ help: to call the function stored in `closure`, surround the field access with parentheses
31
34
|
32
- = help: use `(o_func.closure)(...)` if you meant to call the function stored in the `closure` field
35
+ LL | (o_func.closure)();
36
+ | ^ ^
33
37
34
38
error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
35
39
--> $DIR/issue-2392.rs:49:14
@@ -39,8 +43,10 @@ LL | struct BoxedObj {
39
43
...
40
44
LL | boxed_fn.boxed_closure();
41
45
| ^^^^^^^^^^^^^ field, not a method
46
+ help: to call the function stored in `boxed_closure`, surround the field access with parentheses
42
47
|
43
- = help: use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
48
+ LL | (boxed_fn.boxed_closure)();
49
+ | ^ ^
44
50
45
51
error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
46
52
--> $DIR/issue-2392.rs:52:19
@@ -50,8 +56,10 @@ LL | struct BoxedObj {
50
56
...
51
57
LL | boxed_closure.boxed_closure();
52
58
| ^^^^^^^^^^^^^ field, not a method
59
+ help: to call the function stored in `boxed_closure`, surround the field access with parentheses
53
60
|
54
- = help: use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
61
+ LL | (boxed_closure.boxed_closure)();
62
+ | ^ ^
55
63
56
64
error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
57
65
--> $DIR/issue-2392.rs:57:12
@@ -61,8 +69,10 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
61
69
...
62
70
LL | w.wrap.closure();
63
71
| ^^^^^^^ field, not a method
72
+ help: to call the function stored in `closure`, surround the field access with parentheses
64
73
|
65
- = help: use `(w.wrap.closure)(...)` if you meant to call the function stored in the `closure` field
74
+ LL | (w.wrap.closure)();
75
+ | ^ ^
66
76
67
77
error[E0599]: no method named `not_closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
68
78
--> $DIR/issue-2392.rs:59:12
@@ -71,9 +81,9 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
71
81
| -------------------------------------- method `not_closure` not found for this
72
82
...
73
83
LL | w.wrap.not_closure();
74
- | ^^^^^^^^^^^ field, not a method
75
- |
76
- = help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`?
84
+ | ^^^^^^^^^^^-- help: remove the arguments
85
+ | |
86
+ | field, not a method
77
87
78
88
error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<(dyn std::boxed::FnBox<(), Output=u32> + 'static)>>` in the current scope
79
89
--> $DIR/issue-2392.rs:62:24
@@ -83,8 +93,10 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
83
93
...
84
94
LL | check_expression().closure();
85
95
| ^^^^^^^ field, not a method
96
+ help: to call the function stored in `closure`, surround the field access with parentheses
86
97
|
87
- = help: use `(check_expression().closure)(...)` if you meant to call the function stored in the `closure` field
98
+ LL | (check_expression().closure)();
99
+ | ^ ^
88
100
89
101
error[E0599]: no method named `f1` found for type `FuncContainer` in the current scope
90
102
--> $DIR/issue-2392.rs:68:31
@@ -94,8 +106,10 @@ LL | struct FuncContainer {
94
106
...
95
107
LL | (*self.container).f1(1);
96
108
| ^^ field, not a method
109
+ help: to call the function stored in `f1`, surround the field access with parentheses
97
110
|
98
- = help: use `((*self.container).f1)(...)` if you meant to call the function stored in the `f1` field
111
+ LL | ((*self.container).f1)(1);
112
+ | ^ ^
99
113
100
114
error[E0599]: no method named `f2` found for type `FuncContainer` in the current scope
101
115
--> $DIR/issue-2392.rs:69:31
@@ -105,8 +119,10 @@ LL | struct FuncContainer {
105
119
...
106
120
LL | (*self.container).f2(1);
107
121
| ^^ field, not a method
122
+ help: to call the function stored in `f2`, surround the field access with parentheses
108
123
|
109
- = help: use `((*self.container).f2)(...)` if you meant to call the function stored in the `f2` field
124
+ LL | ((*self.container).f2)(1);
125
+ | ^ ^
110
126
111
127
error[E0599]: no method named `f3` found for type `FuncContainer` in the current scope
112
128
--> $DIR/issue-2392.rs:70:31
@@ -116,8 +132,10 @@ LL | struct FuncContainer {
116
132
...
117
133
LL | (*self.container).f3(1);
118
134
| ^^ field, not a method
135
+ help: to call the function stored in `f3`, surround the field access with parentheses
119
136
|
120
- = help: use `((*self.container).f3)(...)` if you meant to call the function stored in the `f3` field
137
+ LL | ((*self.container).f3)(1);
138
+ | ^ ^
121
139
122
140
error: aborting due to 11 previous errors
123
141
0 commit comments