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