fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.5 KiB45 linesraw
1error[E0530]: match bindings cannot shadow tuple structs
2  --> $DIR/empty-struct-tuple-pat.rs:22:9
3   |
4LL | struct Empty2();
5   | ---------------- the tuple struct `Empty2` is defined here
6...
7LL |         Empty2 => ()
8   |         ^^^^^^ cannot be named the same as a tuple struct
9
10error[E0530]: match bindings cannot shadow tuple structs
11  --> $DIR/empty-struct-tuple-pat.rs:25:9
12   |
13LL | use empty_struct::*;
14   |     --------------- the tuple struct `XEmpty6` is imported here
15...
16LL |         XEmpty6 => ()
17   |         ^^^^^^^ cannot be named the same as a tuple struct
18
19error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::Empty4`
20  --> $DIR/empty-struct-tuple-pat.rs:29:9
21   |
22LL |     Empty4()
23   |     -------- `E::Empty4` defined here
24...
25LL |         E::Empty4 => ()
26   |         ^^^^^^^^^ did you mean `E::Empty4( /* fields */ )`?
27
28error[E0532]: expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5`
29  --> $DIR/empty-struct-tuple-pat.rs:33:9
30   |
31LL |         XE::XEmpty5 => (),
32   |         ^^^^-------
33   |         |   |
34   |         |   help: a unit variant with a similar name exists: `XEmpty4`
35   |         did you mean `XE::XEmpty5( /* fields */ )`?
36   | 
37  ::: $DIR/auxiliary/empty-struct.rs:7:5
38   |
39LL |     XEmpty4,
40   |     ------- similarly named unit variant `XEmpty4` defined here
41
42error: aborting due to 4 previous errors
43
44Some errors have detailed explanations: E0530, E0532.
45For more information about an error, try `rustc --explain E0530`.