@@ -5,7 +5,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
5
5
| ------------- method `closure` not found for this struct
6
6
...
7
7
LL | o_closure.closure();
8
- | ^^^^^^^ field, not a method
8
+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
9
9
|
10
10
help: to call the function stored in `closure`, surround the field access with parentheses
11
11
|
@@ -21,7 +21,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
21
21
LL | o_closure.not_closure();
22
22
| ^^^^^^^^^^^-- help: remove the arguments
23
23
| |
24
- | field, not a method
24
+ | `not_closure` is a field in the current scope, but is used like a method
25
25
26
26
error[E0599]: no method named `closure` found for struct `Obj` in the current scope
27
27
--> $DIR/issue-2392.rs:42:12
@@ -30,7 +30,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
30
30
| ------------- method `closure` not found for this struct
31
31
...
32
32
LL | o_func.closure();
33
- | ^^^^^^^ field, not a method
33
+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
34
34
|
35
35
help: to call the function stored in `closure`, surround the field access with parentheses
36
36
|
@@ -44,7 +44,7 @@ LL | struct BoxedObj {
44
44
| --------------- method `boxed_closure` not found for this struct
45
45
...
46
46
LL | boxed_fn.boxed_closure();
47
- | ^^^^^^^^^^^^^ field, not a method
47
+ | ^^^^^^^^^^^^^ `boxed_closure` is a field in the current scope, but is used like a method
48
48
|
49
49
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
50
50
|
@@ -58,7 +58,7 @@ LL | struct BoxedObj {
58
58
| --------------- method `boxed_closure` not found for this struct
59
59
...
60
60
LL | boxed_closure.boxed_closure();
61
- | ^^^^^^^^^^^^^ field, not a method
61
+ | ^^^^^^^^^^^^^ `boxed_closure` is a field in the current scope, but is used like a method
62
62
|
63
63
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
64
64
|
@@ -72,7 +72,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
72
72
| ------------- method `closure` not found for this struct
73
73
...
74
74
LL | w.wrap.closure();
75
- | ^^^^^^^ field, not a method
75
+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
76
76
|
77
77
help: to call the function stored in `closure`, surround the field access with parentheses
78
78
|
@@ -88,7 +88,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
88
88
LL | w.wrap.not_closure();
89
89
| ^^^^^^^^^^^-- help: remove the arguments
90
90
| |
91
- | field, not a method
91
+ | `not_closure` is a field in the current scope, but is used like a method
92
92
93
93
error[E0599]: no method named `closure` found for struct `Obj` in the current scope
94
94
--> $DIR/issue-2392.rs:58:24
@@ -97,7 +97,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
97
97
| ------------- method `closure` not found for this struct
98
98
...
99
99
LL | check_expression().closure();
100
- | ^^^^^^^ field, not a method
100
+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
101
101
|
102
102
help: to call the function stored in `closure`, surround the field access with parentheses
103
103
|
@@ -111,7 +111,7 @@ LL | struct FuncContainer {
111
111
| -------------------- method `f1` not found for this struct
112
112
...
113
113
LL | (*self.container).f1(1);
114
- | ^^ field, not a method
114
+ | ^^ `f1` is a field in the current scope, but is used like a method
115
115
|
116
116
help: to call the function stored in `f1`, surround the field access with parentheses
117
117
|
@@ -125,7 +125,7 @@ LL | struct FuncContainer {
125
125
| -------------------- method `f2` not found for this struct
126
126
...
127
127
LL | (*self.container).f2(1);
128
- | ^^ field, not a method
128
+ | ^^ `f2` is a field in the current scope, but is used like a method
129
129
|
130
130
help: to call the function stored in `f2`, surround the field access with parentheses
131
131
|
@@ -139,7 +139,7 @@ LL | struct FuncContainer {
139
139
| -------------------- method `f3` not found for this struct
140
140
...
141
141
LL | (*self.container).f3(1);
142
- | ^^ field, not a method
142
+ | ^^ `f3` is a field in the current scope, but is used like a method
143
143
|
144
144
help: to call the function stored in `f3`, surround the field access with parentheses
145
145
|
0 commit comments