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