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