diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2021-02-11 20:46:58 +0000 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2021-02-13 19:29:55 +0000 |
| commit | dfa581ff8747c1d5804a08e8201031a37c2ea14a (patch) | |
| tree | a586a5aa7c8e5c165d00a605bb99737930772e7e | |
| parent | 7e0241c63755ea28045d512b742f50b307874419 (diff) | |
| download | rust-dfa581ff8747c1d5804a08e8201031a37c2ea14a.tar.gz rust-dfa581ff8747c1d5804a08e8201031a37c2ea14a.zip | |
Fix pretty printing of generic associated type constraints
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 1 | ||||
| -rw-r--r-- | src/test/pretty/gat-bounds.rs | 2 |
2 files changed, 3 insertions, 0 deletions
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<T> where Self: Sized = u32; } +fn f<T: X<Y<()> = i32>>() {} + fn main() { } |
