deriv(Hash) for single-variant enum should not hash discriminant

Fixes #39137
This commit is contained in:
Stepan Koltsov
2017-06-16 22:59:20 +03:00
parent b40be00a0c
commit f11e40a811
6 changed files with 20 additions and 10 deletions

View File

@@ -60,7 +60,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<E
// based on the "shape".
let (ident, is_struct) = match *substr.fields {
Struct(vdata, _) => (substr.type_ident, vdata.is_struct()),
EnumMatching(_, v, _) => (v.node.name, v.node.data.is_struct()),
EnumMatching(_, _, v, _) => (v.node.name, v.node.data.is_struct()),
EnumNonMatchingCollapsed(..) |
StaticStruct(..) |
StaticEnum(..) => cx.span_bug(span, "nonsensical .fields in `#[derive(Debug)]`"),