From dfa581ff8747c1d5804a08e8201031a37c2ea14a Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Thu, 11 Feb 2021 20:46:58 +0000 Subject: [PATCH] Fix pretty printing of generic associated type constraints --- compiler/rustc_ast_pretty/src/pprust/state.rs | 1 + src/test/pretty/gat-bounds.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 01e234c9be9..cbeaa6018d1 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -914,6 +914,7 @@ impl<'a> State<'a> { pub fn print_assoc_constraint(&mut self, constraint: &ast::AssocTyConstraint) { self.print_ident(constraint.ident); + constraint.gen_args.as_ref().map(|args| self.print_generic_args(args, false)); self.s.space(); match &constraint.kind { ast::AssocTyConstraintKind::Equality { ty } => { diff --git a/src/test/pretty/gat-bounds.rs b/src/test/pretty/gat-bounds.rs index 789e4bc80ac..8877c6cc992 100644 --- a/src/test/pretty/gat-bounds.rs +++ b/src/test/pretty/gat-bounds.rs @@ -13,4 +13,6 @@ impl X for () { type Y where Self: Sized = u32; } +fn f = i32>>() {} + fn main() { }