rustc update: Remove variant visibility

https://github.com/rust-lang/rust/pull/28440
This commit is contained in:
Sebastian Ullrich 2015-09-19 17:28:00 +02:00
parent fa5772e9bb
commit 3da7adbc3f

View File

@ -507,8 +507,6 @@ fn visit_variant(&mut self, field: &ast::Variant, last_field: bool, next_span_st
let result = match field.node.kind {
ast::VariantKind::TupleVariantKind(ref types) => {
let vis = format_visibility(field.node.vis);
self.buffer.push_str(vis);
let name = field.node.name.to_string();
self.buffer.push_str(&name);
@ -531,8 +529,7 @@ fn visit_variant(&mut self, field: &ast::Variant, last_field: bool, next_span_st
result.push('(');
let indent = self.block_indent + vis.len() + field.node.name.to_string().len() +
1; // Open paren
let indent = self.block_indent + field.node.name.to_string().len() + "(".len();
let comma_cost = if self.config.enum_trailing_comma {
1
@ -565,9 +562,8 @@ fn visit_variant(&mut self, field: &ast::Variant, last_field: bool, next_span_st
result.push_str(&expr_snippet);
// Make sure we do not exceed column limit
// 4 = " = ,"
assert!(self.config.max_width >=
vis.len() + name.len() + expr_snippet.len() + 4,
name.len() + expr_snippet.len() + " = ,".len(),
"Enum variant exceeded column limit");
}
@ -577,7 +573,7 @@ fn visit_variant(&mut self, field: &ast::Variant, last_field: bool, next_span_st
// TODO: Should limit the width, as we have a trailing comma
let struct_rewrite = self.format_struct("",
field.node.name,
field.node.vis,
ast::Visibility::Inherited,
struct_def,
None,
field.span,