]> git.proxmox.com Git - rustc.git/blob - tests/ui/structs/struct-fn-in-definition.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / structs / struct-fn-in-definition.stderr
1 error: functions are not allowed in struct definitions
2 --> $DIR/struct-fn-in-definition.rs:9:5
3 |
4 LL | struct S {
5 | - while parsing this struct
6 ...
7 LL | fn foo() {}
8 | ^^^^^^^^^^^
9 |
10 = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
11 = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information
12
13 error: functions are not allowed in union definitions
14 --> $DIR/struct-fn-in-definition.rs:18:5
15 |
16 LL | union U {
17 | - while parsing this union
18 ...
19 LL | fn foo() {}
20 | ^^^^^^^^^^^
21 |
22 = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
23 = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information
24
25 error: functions are not allowed in enum definitions
26 --> $DIR/struct-fn-in-definition.rs:27:5
27 |
28 LL | enum E {
29 | - while parsing this enum
30 ...
31 LL | fn foo() {}
32 | ^^^^^^^^^^^
33 |
34 = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
35 = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information
36 = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
37
38 error: aborting due to 3 previous errors
39