fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB37 linesraw
1error: invalid `struct` delimiters or `fn` call arguments
2  --> $DIR/recover-from-bad-variant.rs:7:13
3   |
4LL |     let x = Enum::Foo(a: 3, b: 4);
5   |             ^^^^^^^^^^^^^^^^^^^^^
6   |
7help: if `Enum::Foo` is a struct, use braces as delimiters
8   |
9LL |     let x = Enum::Foo { a: 3, b: 4 };
10   |                       ~            ~
11help: if `Enum::Foo` is a function, use the arguments directly
12   |
13LL -     let x = Enum::Foo(a: 3, b: 4);
14LL +     let x = Enum::Foo(3, 4);
15   |
16
17error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
18  --> $DIR/recover-from-bad-variant.rs:10:9
19   |
20LL |         Enum::Foo(a, b) => {}
21   |         ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
22
23error[E0769]: tuple variant `Enum::Bar` written as struct variant
24  --> $DIR/recover-from-bad-variant.rs:12:9
25   |
26LL |         Enum::Bar { a, b } => {}
27   |         ^^^^^^^^^^^^^^^^^^
28   |
29help: use the tuple variant pattern syntax instead
30   |
31LL |         Enum::Bar(a, b) => {}
32   |                  ~~~~~~
33
34error: aborting due to 3 previous errors
35
36Some errors have detailed explanations: E0164, E0769.
37For more information about an error, try `rustc --explain E0164`.