summaryrefslogtreecommitdiffstats
path: root/src/test/ui/confuse-field-and-method/issue-2392.stderr
blob: 440fbb27c0040ef1bea903cecd3856c8fee1d33f (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
error[E0599]: no method named `closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:36:15
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `closure` not found for this struct
...
LL |     o_closure.closure();
   |               ^^^^^^^ field, not a method
   |
help: to call the function stored in `closure`, surround the field access with parentheses
   |
LL |     (o_closure.closure)();
   |     +                 +

error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:38:15
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `not_closure` not found for this struct
...
LL |     o_closure.not_closure();
   |               ^^^^^^^^^^^-- help: remove the arguments
   |               |
   |               field, not a method

error[E0599]: no method named `closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:42:12
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `closure` not found for this struct
...
LL |     o_func.closure();
   |            ^^^^^^^ field, not a method
   |
help: to call the function stored in `closure`, surround the field access with parentheses
   |
LL |     (o_func.closure)();
   |     +              +

error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
  --> $DIR/issue-2392.rs:45:14
   |
LL | struct BoxedObj {
   | --------------- method `boxed_closure` not found for this struct
...
LL |     boxed_fn.boxed_closure();
   |              ^^^^^^^^^^^^^ field, not a method
   |
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
   |
LL |     (boxed_fn.boxed_closure)();
   |     +                      +

error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
  --> $DIR/issue-2392.rs:48:19
   |
LL | struct BoxedObj {
   | --------------- method `boxed_closure` not found for this struct
...
LL |     boxed_closure.boxed_closure();
   |                   ^^^^^^^^^^^^^ field, not a method
   |
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
   |
LL |     (boxed_closure.boxed_closure)();
   |     +                           +

error[E0599]: no method named `closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:53:12
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `closure` not found for this struct
...
LL |     w.wrap.closure();
   |            ^^^^^^^ field, not a method
   |
help: to call the function stored in `closure`, surround the field access with parentheses
   |
LL |     (w.wrap.closure)();
   |     +              +

error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:55:12
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `not_closure` not found for this struct
...
LL |     w.wrap.not_closure();
   |            ^^^^^^^^^^^-- help: remove the arguments
   |            |
   |            field, not a method

error[E0599]: no method named `closure` found for struct `Obj` in the current scope
  --> $DIR/issue-2392.rs:58:24
   |
LL | struct Obj<F> where F: FnOnce() -> u32 {
   | ------------- method `closure` not found for this struct
...
LL |     check_expression().closure();
   |                        ^^^^^^^ field, not a method
   |
help: to call the function stored in `closure`, surround the field access with parentheses
   |
LL |     (check_expression().closure)();
   |     +                          +

error[E0599]: no method named `f1` found for struct `FuncContainer` in the current scope
  --> $DIR/issue-2392.rs:64:31
   |
LL | struct FuncContainer {
   | -------------------- method `f1` not found for this struct
...
LL |             (*self.container).f1(1);
   |                               ^^ field, not a method
   |
help: to call the function stored in `f1`, surround the field access with parentheses
   |
LL |             ((*self.container).f1)(1);
   |             +                    +

error[E0599]: no method named `f2` found for struct `FuncContainer` in the current scope
  --> $DIR/issue-2392.rs:65:31
   |
LL | struct FuncContainer {
   | -------------------- method `f2` not found for this struct
...
LL |             (*self.container).f2(1);
   |                               ^^ field, not a method
   |
help: to call the function stored in `f2`, surround the field access with parentheses
   |
LL |             ((*self.container).f2)(1);
   |             +                    +

error[E0599]: no method named `f3` found for struct `FuncContainer` in the current scope
  --> $DIR/issue-2392.rs:66:31
   |
LL | struct FuncContainer {
   | -------------------- method `f3` not found for this struct
...
LL |             (*self.container).f3(1);
   |                               ^^ field, not a method
   |
help: to call the function stored in `f3`, surround the field access with parentheses
   |
LL |             ((*self.container).f3)(1);
   |             +                    +

error: aborting due to 11 previous errors

For more information about this error, try `rustc --explain E0599`.