fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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