diff options
Diffstat (limited to 'compiler/rustc_hir_pretty/src/lib.rs')
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 0b5eb1d8266..a9aa192bbcc 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -138,9 +138,6 @@ impl std::ops::DerefMut for State<'_> { } impl<'a> PrintState<'a> for State<'a> { - fn insert_extra_parens(&self) -> bool { - true - } fn comments(&mut self) -> &mut Option<Comments<'a>> { &mut self.comments } @@ -2205,9 +2202,12 @@ impl<'a> State<'a> { self.print_type(&default) } } - GenericParamKind::Const { ref ty } => { + GenericParamKind::Const { ref ty, ref default } => { self.word_space(":"); - self.print_type(ty) + self.print_type(ty); + if let Some(ref _default) = default { + // FIXME(const_generics_defaults): print the `default` value here + } } } } @@ -2230,19 +2230,19 @@ impl<'a> State<'a> { } match predicate { - &hir::WherePredicate::BoundPredicate(hir::WhereBoundPredicate { - ref bound_generic_params, - ref bounded_ty, + hir::WherePredicate::BoundPredicate(hir::WhereBoundPredicate { + bound_generic_params, + bounded_ty, bounds, .. }) => { self.print_formal_generic_params(bound_generic_params); self.print_type(&bounded_ty); - self.print_bounds(":", bounds); + self.print_bounds(":", *bounds); } - &hir::WherePredicate::RegionPredicate(hir::WhereRegionPredicate { - ref lifetime, - ref bounds, + hir::WherePredicate::RegionPredicate(hir::WhereRegionPredicate { + lifetime, + bounds, .. }) => { self.print_lifetime(lifetime); @@ -2261,10 +2261,8 @@ impl<'a> State<'a> { } } } - &hir::WherePredicate::EqPredicate(hir::WhereEqPredicate { - ref lhs_ty, - ref rhs_ty, - .. + hir::WherePredicate::EqPredicate(hir::WhereEqPredicate { + lhs_ty, rhs_ty, .. }) => { self.print_type(lhs_ty); self.s.space(); |
