Appease tidy and fix save-analysis config for dist builds

This commit is contained in:
Nick Cameron 2017-08-03 10:20:01 +12:00
parent 5abbf798e7
commit 2683ba631b
2 changed files with 13 additions and 12 deletions

View File

@ -188,7 +188,7 @@ fn main() {
cmd.arg("-Zsave-analysis");
cmd.env("RUST_SAVE_ANALYSIS_CONFIG",
"{\"output_file\": null,\"full_docs\": false,\"pub_only\": true,\
\"signatures\": false,\"borrow_data\": false}");
\"distro_crate\": true,\"signatures\": false,\"borrow_data\": false}");
}
// Dealing with rpath here is a little special, so let's go into some

View File

@ -561,17 +561,18 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
if let ast::ItemKind::Struct(ast::VariantData::Struct(ref fields, _), _) = item.node
{
let include_priv_fields = !self.save_ctxt.config.pub_only;
let fields_str = fields.iter()
.enumerate()
.filter_map(|(i, f)| {
if include_priv_fields || f.vis == ast::Visibility::Public {
f.ident.map(|i| i.to_string()).or_else(|| Some(i.to_string()))
} else {
None
}
})
.collect::<Vec<_>>()
.join(", ");
let fields_str = fields
.iter()
.enumerate()
.filter_map(|(i, f)| {
if include_priv_fields || f.vis == ast::Visibility::Public {
f.ident.map(|i| i.to_string()).or_else(|| Some(i.to_string()))
} else {
None
}
})
.collect::<Vec<_>>()
.join(", ");
let value = format!("{} {{ {} }}", name, fields_str);
(value, fields.iter().map(|f| ::id_from_node_id(f.id, &self.save_ctxt)).collect())
} else {