diff options
| author | bors <bors@rust-lang.org> | 2016-04-06 05:04:15 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-06 05:04:15 -0700 |
| commit | 943ec3bdfc9ba28e94b6d00a2b53fb2cd8b21655 (patch) | |
| tree | 30b2cefa099bea233f2e257116c5ec99589aaa63 /src/libsyntax/print | |
| parent | 772c600d4d6f39daa6d07d1a60ee0df3d3426978 (diff) | |
| parent | 552af51ffb9f4ae08a7ee3bf27b0e8309006ca6f (diff) | |
Auto merge of #32767 - Manishearth:breakingbatch, r=eddyb
Batch up all plugin breaking changes https://github.com/rust-lang/rust/pull/32688 already landed so we should get this into the same nightly. cc https://github.com/rust-lang/rust/issues/31645
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index a8f28ed3d9e..e2b1d2f5e7a 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1407,14 +1407,9 @@ impl<'a> State<'a> { self.commasep( Inconsistent, struct_def.fields(), |s, field| { - match field.node.kind { - ast::NamedField(..) => panic!("unexpected named field"), - ast::UnnamedField(ref vis) => { - s.print_visibility(vis)?; - s.maybe_print_comment(field.span.lo)?; - s.print_type(&field.node.ty) - } - } + s.print_visibility(&field.vis)?; + s.maybe_print_comment(field.span.lo)?; + s.print_type(&field.ty) } )?; self.pclose()?; @@ -1432,19 +1427,14 @@ impl<'a> State<'a> { self.hardbreak_if_not_bol()?; for field in struct_def.fields() { - match field.node.kind { - ast::UnnamedField(..) => panic!("unexpected unnamed field"), - ast::NamedField(ident, ref visibility) => { - self.hardbreak_if_not_bol()?; - self.maybe_print_comment(field.span.lo)?; - self.print_outer_attributes(&field.node.attrs)?; - self.print_visibility(visibility)?; - self.print_ident(ident)?; - self.word_nbsp(":")?; - self.print_type(&field.node.ty)?; - word(&mut self.s, ",")?; - } - } + self.hardbreak_if_not_bol()?; + self.maybe_print_comment(field.span.lo)?; + self.print_outer_attributes(&field.attrs)?; + self.print_visibility(&field.vis)?; + self.print_ident(field.ident.unwrap())?; + self.word_nbsp(":")?; + self.print_type(&field.ty)?; + word(&mut self.s, ",")?; } self.bclose(span) |
