@@ -5,7 +5,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
55 | ------------- method `closure` not found for this struct
66...
77LL | o_closure.closure();
8- | ^^^^^^^ field, not a method
8+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
99 |
1010help: to call the function stored in `closure`, surround the field access with parentheses
1111 |
@@ -21,7 +21,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
2121LL | o_closure.not_closure();
2222 | ^^^^^^^^^^^-- help: remove the arguments
2323 | |
24- | field, not a method
24+ | `not_closure` is a field in the current scope, but is used like a method
2525
2626error[E0599]: no method named `closure` found for struct `Obj` in the current scope
2727 --> $DIR/issue-2392.rs:42:12
@@ -30,7 +30,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
3030 | ------------- method `closure` not found for this struct
3131...
3232LL | o_func.closure();
33- | ^^^^^^^ field, not a method
33+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
3434 |
3535help: to call the function stored in `closure`, surround the field access with parentheses
3636 |
@@ -44,7 +44,7 @@ LL | struct BoxedObj {
4444 | --------------- method `boxed_closure` not found for this struct
4545...
4646LL | 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
4848 |
4949help: to call the function stored in `boxed_closure`, surround the field access with parentheses
5050 |
@@ -58,7 +58,7 @@ LL | struct BoxedObj {
5858 | --------------- method `boxed_closure` not found for this struct
5959...
6060LL | 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
6262 |
6363help: to call the function stored in `boxed_closure`, surround the field access with parentheses
6464 |
@@ -72,7 +72,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
7272 | ------------- method `closure` not found for this struct
7373...
7474LL | w.wrap.closure();
75- | ^^^^^^^ field, not a method
75+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
7676 |
7777help: to call the function stored in `closure`, surround the field access with parentheses
7878 |
@@ -88,7 +88,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
8888LL | w.wrap.not_closure();
8989 | ^^^^^^^^^^^-- help: remove the arguments
9090 | |
91- | field, not a method
91+ | `not_closure` is a field in the current scope, but is used like a method
9292
9393error[E0599]: no method named `closure` found for struct `Obj` in the current scope
9494 --> $DIR/issue-2392.rs:58:24
@@ -97,7 +97,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
9797 | ------------- method `closure` not found for this struct
9898...
9999LL | check_expression().closure();
100- | ^^^^^^^ field, not a method
100+ | ^^^^^^^ `closure` is a field in the current scope, but is used like a method
101101 |
102102help: to call the function stored in `closure`, surround the field access with parentheses
103103 |
@@ -111,7 +111,7 @@ LL | struct FuncContainer {
111111 | -------------------- method `f1` not found for this struct
112112...
113113LL | (*self.container).f1(1);
114- | ^^ field, not a method
114+ | ^^ `f1` is a field in the current scope, but is used like a method
115115 |
116116help: to call the function stored in `f1`, surround the field access with parentheses
117117 |
@@ -125,7 +125,7 @@ LL | struct FuncContainer {
125125 | -------------------- method `f2` not found for this struct
126126...
127127LL | (*self.container).f2(1);
128- | ^^ field, not a method
128+ | ^^ `f2` is a field in the current scope, but is used like a method
129129 |
130130help: to call the function stored in `f2`, surround the field access with parentheses
131131 |
@@ -139,7 +139,7 @@ LL | struct FuncContainer {
139139 | -------------------- method `f3` not found for this struct
140140...
141141LL | (*self.container).f3(1);
142- | ^^ field, not a method
142+ | ^^ `f3` is a field in the current scope, but is used like a method
143143 |
144144help: to call the function stored in `f3`, surround the field access with parentheses
145145 |
0 commit comments