Skip to content

Commit 3da7adb

Browse files
committed
rustc update: Remove variant visibility
rust-lang/rust#28440
1 parent fa5772e commit 3da7adb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/items.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,6 @@ impl<'a> FmtVisitor<'a> {
507507

508508
let result = match field.node.kind {
509509
ast::VariantKind::TupleVariantKind(ref types) => {
510-
let vis = format_visibility(field.node.vis);
511-
self.buffer.push_str(vis);
512510
let name = field.node.name.to_string();
513511
self.buffer.push_str(&name);
514512

@@ -531,8 +529,7 @@ impl<'a> FmtVisitor<'a> {
531529

532530
result.push('(');
533531

534-
let indent = self.block_indent + vis.len() + field.node.name.to_string().len() +
535-
1; // Open paren
532+
let indent = self.block_indent + field.node.name.to_string().len() + "(".len();
536533

537534
let comma_cost = if self.config.enum_trailing_comma {
538535
1
@@ -565,9 +562,8 @@ impl<'a> FmtVisitor<'a> {
565562
result.push_str(&expr_snippet);
566563

567564
// Make sure we do not exceed column limit
568-
// 4 = " = ,"
569565
assert!(self.config.max_width >=
570-
vis.len() + name.len() + expr_snippet.len() + 4,
566+
name.len() + expr_snippet.len() + " = ,".len(),
571567
"Enum variant exceeded column limit");
572568
}
573569

@@ -577,7 +573,7 @@ impl<'a> FmtVisitor<'a> {
577573
// TODO: Should limit the width, as we have a trailing comma
578574
let struct_rewrite = self.format_struct("",
579575
field.node.name,
580-
field.node.vis,
576+
ast::Visibility::Inherited,
581577
struct_def,
582578
None,
583579
field.span,

0 commit comments

Comments
 (0)