Change:
error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` --> $DIR/empty-struct-unit-pat.rs:21:9 | <ins> LL | struct Empty2; | -------------- `Empty2` defined here ... </ins> LL |         Empty2() => () <del> |         ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` </del> <ins> |         ^^^^^^^^ </ins> | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); | --------------------- similarly named tuple struct `XEmpty6` defined here <ins> | help: use this syntax instead | LL |         Empty2 => () |         ^^^^^^ help: a tuple struct with a similar name exists | LL |         XEmpty6() => () |         ^^^^^^^ </ins> error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:24:9 | LL |         XEmpty2() => () <del> |         ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` </del> <ins> |         ^^^^^^^^^ </ins> | <del> ::: $DIR/auxiliary/empty-struct.rs:3:1 </del> <ins> ::: $DIR/auxiliary/empty-struct.rs:2:1 </ins> | <ins> LL | pub struct XEmpty2; | ------------------- `XEmpty2` defined here </ins> LL | pub struct XEmpty6(); | --------------------- similarly named tuple struct `XEmpty6` defined here <ins> | help: use this syntax instead | LL |         XEmpty2 => () |         ^^^^^^^ help: a tuple struct with a similar name exists | LL |         XEmpty6() => () |         ^^^^^^^ </ins> error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` --> $DIR/empty-struct-unit-pat.rs:28:9 | <ins> LL | struct Empty2; | -------------- `Empty2` defined here ... </ins> LL |         Empty2(..) => () <del> |         ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` </del> <ins> |         ^^^^^^^^^^ </ins> | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); | --------------------- similarly named tuple struct `XEmpty6` defined here <ins> | help: use this syntax instead | LL |         Empty2 => () |         ^^^^^^ help: a tuple struct with a similar name exists | LL |         XEmpty6(..) => () |         ^^^^^^^ </ins> error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:32:9 | LL |         XEmpty2(..) => () <del> |         ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6` </del> <ins> |         ^^^^^^^^^^^ </ins> | <del> ::: $DIR/auxiliary/empty-struct.rs:3:1 </del> <ins> ::: $DIR/auxiliary/empty-struct.rs:2:1 </ins> | <ins> LL | pub struct XEmpty2; | ------------------- `XEmpty2` defined here </ins> LL | pub struct XEmpty6(); | --------------------- similarly named tuple struct `XEmpty6` defined here <ins> | help: use this syntax instead | LL |         XEmpty2 => () |         ^^^^^^^ help: a tuple struct with a similar name exists | LL |         XEmpty6(..) => () |         ^^^^^^^ </ins> error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:37:9 | <ins> LL |     Empty4 |     ------ `E::Empty4` defined here ... </ins> LL |         E::Empty4() => () <del> |         ^^^^^^^^^ not a tuple struct or tuple variant </del> <ins> |         ^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` </ins> error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:41:9 | LL |         XE::XEmpty4() => (), <del> |         ^^^^------- |             | |             help: a tuple variant with a similar name exists: `XEmpty5` </del> <ins> |         ^^^^^^^^^^^^^ </ins> | <del> ::: $DIR/auxiliary/empty-struct.rs:8:5 </del> <ins> ::: $DIR/auxiliary/empty-struct.rs:7:5 </ins> | <ins> LL |     XEmpty4, |     ------- `XE::XEmpty4` defined here </ins> LL |     XEmpty5(), |     --------- similarly named tuple variant `XEmpty5` defined here <ins> | help: use this syntax instead | LL |         XE::XEmpty4 => (), |         ^^^^^^^^^^^ help: a tuple variant with a similar name exists | LL |         XE::XEmpty5() => (), |             ^^^^^^^ </ins> error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:46:9 | <ins> LL |     Empty4 |     ------ `E::Empty4` defined here ... </ins> LL |         E::Empty4(..) => () <del> |         ^^^^^^^^^ not a tuple struct or tuple variant </del> <ins> |         ^^^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` </ins> error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:50:9 | LL |         XE::XEmpty4(..) => (), <del> |         ^^^^------- |             | |             help: a tuple variant with a similar name exists: `XEmpty5` </del> <ins> |         ^^^^^^^^^^^^^^^ </ins> | <del> ::: $DIR/auxiliary/empty-struct.rs:8:5 </del> <ins> ::: $DIR/auxiliary/empty-struct.rs:7:5 </ins> | <ins> LL |     XEmpty4, |     ------- `XE::XEmpty4` defined here </ins> LL |     XEmpty5(), |     --------- similarly named tuple variant `XEmpty5` defined here <ins> | help: use this syntax instead | LL |         XE::XEmpty4 => (), |         ^^^^^^^^^^^ help: a tuple variant with a similar name exists | LL |         XE::XEmpty5(..) => (), |             ^^^^^^^ </ins> error: aborting due to 8 previous errors

Discussion:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. If you cannot produce a minimal reproduction case (something that would work in isolation), please provide the steps or even link to a repository that causes the problematic output to occur. -- The current output is: Ideally the output should look like: I'd like it to say "try to use a unit variant like "FarmAnimal::Cow" instead". For example, here's what happens if you use Tuple syntax instead of Struct syntax: So I'd like the new diagnostic to look something like: <!-- If the problem is not self-explanatory, please provide a rationale for the change. --<!-- If dramatically different output is caused by small changes, consider also adding them here. If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. The output might also be different depending on the Edition. --<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
This is an example Ferrous Systems uses in our trainings, and some of our participants have tripped over this lack of suggestion here. The compiler DOES provide diagnostics when you use a struct syntax instead of a tuple syntax.
Alternatively the help could suggest a more direct: "Remove the parenthesis here".
claim
I just wanted to mention , and I wanted to thank you personally for implementing this diagnostics improvement so quickly! Let me know if you have a blog or twitter you'd like us to link to (rather than your GH profile).
Hello, linking to my GH profile is fine. I did not know I would contribute to such an interesting learning experience. Anyway thank you for mentioning me in your blog post .