Auto merge of #31104 - nrc:save-fix-variant-data, r=alexcrichton

This commit is contained in:
bors 2016-01-22 22:42:33 +00:00
commit c2740b6adb
2 changed files with 23 additions and 10 deletions

View File

@ -510,14 +510,28 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
qualname.push_str(name);
let val = self.span.snippet(variant.span);
self.fmt.struct_variant_str(variant.span,
self.span.span_for_first_ident(variant.span),
variant.node.data.id(),
variant.node.data.id(),
&qualname,
&enum_data.qualname,
&val,
enum_data.id);
match variant.node.data {
ast::VariantData::Struct(..) => {
self.fmt.struct_variant_str(variant.span,
self.span.span_for_first_ident(variant.span),
variant.node.data.id(),
&qualname,
&enum_data.qualname,
&val,
enum_data.scope);
}
_ => {
self.fmt.tuple_variant_str(variant.span,
self.span.span_for_first_ident(variant.span),
variant.node.data.id(),
name,
&qualname,
&enum_data.qualname,
&val,
enum_data.scope);
}
}
for field in variant.node.data.fields() {
self.process_struct_field_def(field, variant.node.data.id());

View File

@ -433,14 +433,13 @@ impl<'a, 'tcx: 'a> FmtStrs<'a, 'tcx> {
span: Span,
sub_span: Option<Span>,
id: NodeId,
ctor_id: NodeId,
name: &str,
typ: &str,
val: &str,
scope_id: NodeId) {
let id = self.normalize_node_id(id);
let ctor_id = id;
let scope_id = self.normalize_node_id(scope_id);
let ctor_id = self.normalize_node_id(ctor_id);
self.check_and_record(VariantStruct,
span,
sub_span,