diff options
| author | bors <bors@rust-lang.org> | 2019-08-02 22:44:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-02 22:44:53 +0000 |
| commit | d9bd4b289f07956819c59704d88d9eed61af3a6d (patch) | |
| tree | 4186e474003e5f9e5dc416553a89e2088a05b636 /src/libsyntax | |
| parent | b0e40bfba44836ad30051ffb077c1cfc5bf4a59f (diff) | |
| parent | 4520a39b94a691f58c4a266e2c9d52406dfac414 (diff) | |
Auto merge of #63228 - Centril:rollup-x39p5ga, r=Centril
Rollup of 7 pull requests Successful merges: - #63107 (Added support for armv7-unknown-linux-gnueabi/musleabi) - #63121 (On `format!()` arg count mismatch provide extra info) - #63196 (build_helper: try less confusing method names) - #63206 (remove unsupported test case) - #63208 (Round generator sizes to a multiple of their alignment) - #63212 (Pretty print attributes in `print_arg`) - #63215 (Clarify semantics of mem::zeroed) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 3645ab88d55..07b1aef337f 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2622,27 +2622,23 @@ impl<'a> State<'a> { self.s.word("<"); self.commasep(Inconsistent, &generic_params, |s, param| { + s.print_outer_attributes_inline(¶m.attrs); + match param.kind { ast::GenericParamKind::Lifetime => { - s.print_outer_attributes_inline(¶m.attrs); let lt = ast::Lifetime { id: param.id, ident: param.ident }; s.print_lifetime_bounds(lt, ¶m.bounds) } ast::GenericParamKind::Type { ref default } => { - s.print_outer_attributes_inline(¶m.attrs); s.print_ident(param.ident); s.print_type_bounds(":", ¶m.bounds); - match default { - Some(ref default) => { - s.s.space(); - s.word_space("="); - s.print_type(default) - } - _ => {} + if let Some(ref default) = default { + s.s.space(); + s.word_space("="); + s.print_type(default) } } ast::GenericParamKind::Const { ref ty } => { - s.print_outer_attributes_inline(¶m.attrs); s.word_space("const"); s.print_ident(param.ident); s.s.space(); @@ -2743,6 +2739,9 @@ impl<'a> State<'a> { crate fn print_arg(&mut self, input: &ast::Arg, is_closure: bool) { self.ibox(INDENT_UNIT); + + self.print_outer_attributes_inline(&input.attrs); + match input.ty.node { ast::TyKind::Infer if is_closure => self.print_pat(&input.pat), _ => { |
