about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <mail@marcusklaas.nl>2015-09-19 19:19:34 +0200
committerMarcus Klaas de Vries <mail@marcusklaas.nl>2015-09-19 19:19:34 +0200
commit4e1fff8710d9ad67cdfac08dbd6ffcb0c6fc4bc4 (patch)
tree41ab5e1a549f44be0fd811c0b9f82c47e5c94d3d
parentfa5772e9bb7cf5e8478ea6e207c9dac80c6161c4 (diff)
parent3da7adbc3f15849ed28d84e7b66d028c6f25b3f4 (diff)
Merge pull request #332 from Kha/variant_no_vis
rustc update: Remove variant visibility
-rw-r--r--src/items.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/items.rs b/src/items.rs
index 2b470e03f95..a14310e94ef 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -507,8 +507,6 @@ impl<'a> FmtVisitor<'a> {
 
         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 @@ impl<'a> FmtVisitor<'a> {
 
                     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 @@ impl<'a> FmtVisitor<'a> {
                     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 @@ impl<'a> FmtVisitor<'a> {
                 // 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,