diff options
| author | David Tolnay <dtolnay@gmail.com> | 2022-06-16 17:14:51 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2022-06-16 17:24:50 -0700 |
| commit | fe9635f7c0751aaa23f0b0d2309882a1a4641f9b (patch) | |
| tree | bf79f7eb3a18349397454f0b28bd7904f0ce1591 /compiler/rustc_parse/src | |
| parent | 1b8ca54002cec4affe363584ca0946568beeabf0 (diff) | |
| download | rust-fe9635f7c0751aaa23f0b0d2309882a1a4641f9b.tar.gz rust-fe9635f7c0751aaa23f0b0d2309882a1a4641f9b.zip | |
Fix pretty printing of empty type bound lists in where-clause
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index c56f70e853d..ed671e05970 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1355,7 +1355,10 @@ impl<'a> Parser<'a> { s.print_mutability(mut_ty.mutbl, false); s.popen(); s.print_type(&mut_ty.ty); - s.print_type_bounds(" +", &bounds); + if !bounds.is_empty() { + s.word(" + "); + s.print_type_bounds(&bounds); + } s.pclose() }); |
