Improve error message
This commit is contained in:
parent
e6b14aab05
commit
2a01e263bc
2 changed files with 4 additions and 0 deletions
|
|
@ -867,6 +867,8 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
|||
self.context.span_handler.span_err(span, "empty tuple structs and enum variants \
|
||||
are not allowed, use unit structs and \
|
||||
enum variants instead");
|
||||
self.context.span_handler.span_help(span, "remove trailing () to make a unit \
|
||||
struct or unit enum varian");
|
||||
}
|
||||
}
|
||||
visit::walk_struct_def(self, s)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
|
||||
enum Foo {
|
||||
Bar(), //~ ERROR empty tuple structs and enum variants are not allowed
|
||||
//~^ HELP remove trailing () to make a unit struct or unit enum varian
|
||||
Baz(), //~ ERROR empty tuple structs and enum variants are not allowed
|
||||
//~^ HELP remove trailing () to make a unit struct or unit enum varian
|
||||
Bazar
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue