fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

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