]> git.lizzy.rs Git - rust.git/blob - tests/ui/confuse-field-and-method/issue-2392.stderr
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / tests / ui / confuse-field-and-method / issue-2392.stderr
1 error[E0599]: no method named `closure` found for struct `Obj` in the current scope
2   --> $DIR/issue-2392.rs:36:15
3    |
4 LL | struct Obj<F> where F: FnOnce() -> u32 {
5    | ------------- method `closure` not found for this struct
6 ...
7 LL |     o_closure.closure();
8    |               ^^^^^^^ field, not a method
9    |
10 help: to call the function stored in `closure`, surround the field access with parentheses
11    |
12 LL |     (o_closure.closure)();
13    |     +                 +
14
15 error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
16   --> $DIR/issue-2392.rs:38:15
17    |
18 LL | struct Obj<F> where F: FnOnce() -> u32 {
19    | ------------- method `not_closure` not found for this struct
20 ...
21 LL |     o_closure.not_closure();
22    |               ^^^^^^^^^^^-- help: remove the arguments
23    |               |
24    |               field, not a method
25
26 error[E0599]: no method named `closure` found for struct `Obj` in the current scope
27   --> $DIR/issue-2392.rs:42:12
28    |
29 LL | struct Obj<F> where F: FnOnce() -> u32 {
30    | ------------- method `closure` not found for this struct
31 ...
32 LL |     o_func.closure();
33    |            ^^^^^^^ field, not a method
34    |
35 help: to call the function stored in `closure`, surround the field access with parentheses
36    |
37 LL |     (o_func.closure)();
38    |     +              +
39
40 error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
41   --> $DIR/issue-2392.rs:45:14
42    |
43 LL | struct BoxedObj {
44    | --------------- method `boxed_closure` not found for this struct
45 ...
46 LL |     boxed_fn.boxed_closure();
47    |              ^^^^^^^^^^^^^ field, not a method
48    |
49 help: to call the function stored in `boxed_closure`, surround the field access with parentheses
50    |
51 LL |     (boxed_fn.boxed_closure)();
52    |     +                      +
53
54 error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
55   --> $DIR/issue-2392.rs:48:19
56    |
57 LL | struct BoxedObj {
58    | --------------- method `boxed_closure` not found for this struct
59 ...
60 LL |     boxed_closure.boxed_closure();
61    |                   ^^^^^^^^^^^^^ field, not a method
62    |
63 help: to call the function stored in `boxed_closure`, surround the field access with parentheses
64    |
65 LL |     (boxed_closure.boxed_closure)();
66    |     +                           +
67
68 error[E0599]: no method named `closure` found for struct `Obj` in the current scope
69   --> $DIR/issue-2392.rs:53:12
70    |
71 LL | struct Obj<F> where F: FnOnce() -> u32 {
72    | ------------- method `closure` not found for this struct
73 ...
74 LL |     w.wrap.closure();
75    |            ^^^^^^^ field, not a method
76    |
77 help: to call the function stored in `closure`, surround the field access with parentheses
78    |
79 LL |     (w.wrap.closure)();
80    |     +              +
81
82 error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
83   --> $DIR/issue-2392.rs:55:12
84    |
85 LL | struct Obj<F> where F: FnOnce() -> u32 {
86    | ------------- method `not_closure` not found for this struct
87 ...
88 LL |     w.wrap.not_closure();
89    |            ^^^^^^^^^^^-- help: remove the arguments
90    |            |
91    |            field, not a method
92
93 error[E0599]: no method named `closure` found for struct `Obj` in the current scope
94   --> $DIR/issue-2392.rs:58:24
95    |
96 LL | struct Obj<F> where F: FnOnce() -> u32 {
97    | ------------- method `closure` not found for this struct
98 ...
99 LL |     check_expression().closure();
100    |                        ^^^^^^^ field, not a method
101    |
102 help: to call the function stored in `closure`, surround the field access with parentheses
103    |
104 LL |     (check_expression().closure)();
105    |     +                          +
106
107 error[E0599]: no method named `f1` found for struct `FuncContainer` in the current scope
108   --> $DIR/issue-2392.rs:64:31
109    |
110 LL | struct FuncContainer {
111    | -------------------- method `f1` not found for this struct
112 ...
113 LL |             (*self.container).f1(1);
114    |                               ^^ field, not a method
115    |
116 help: to call the function stored in `f1`, surround the field access with parentheses
117    |
118 LL |             ((*self.container).f1)(1);
119    |             +                    +
120
121 error[E0599]: no method named `f2` found for struct `FuncContainer` in the current scope
122   --> $DIR/issue-2392.rs:65:31
123    |
124 LL | struct FuncContainer {
125    | -------------------- method `f2` not found for this struct
126 ...
127 LL |             (*self.container).f2(1);
128    |                               ^^ field, not a method
129    |
130 help: to call the function stored in `f2`, surround the field access with parentheses
131    |
132 LL |             ((*self.container).f2)(1);
133    |             +                    +
134
135 error[E0599]: no method named `f3` found for struct `FuncContainer` in the current scope
136   --> $DIR/issue-2392.rs:66:31
137    |
138 LL | struct FuncContainer {
139    | -------------------- method `f3` not found for this struct
140 ...
141 LL |             (*self.container).f3(1);
142    |                               ^^ field, not a method
143    |
144 help: to call the function stored in `f3`, surround the field access with parentheses
145    |
146 LL |             ((*self.container).f3)(1);
147    |             +                    +
148
149 error: aborting due to 11 previous errors
150
151 For more information about this error, try `rustc --explain E0599`.