Fix #[derive] for empty tuple structs/variants
This commit is contained in:
parent
7ac11cad3f
commit
28ed8b1592
5 changed files with 32 additions and 10 deletions
|
@ -844,7 +844,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
|||
}
|
||||
fn pat_enum(&self, span: Span, path: ast::Path, subpats: Vec<P<ast::Pat>>) -> P<ast::Pat> {
|
||||
let pat = if subpats.is_empty() {
|
||||
PatKind::Path(None, path)
|
||||
PatKind::Struct(path, Vec::new(), false)
|
||||
} else {
|
||||
PatKind::TupleStruct(path, subpats, None)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue