Skip to content

Commit dfa581f

Browse files
committed
Fix pretty printing of generic associated type constraints
1 parent 7e0241c commit dfa581f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ impl<'a> State<'a> {
914914

915915
pub fn print_assoc_constraint(&mut self, constraint: &ast::AssocTyConstraint) {
916916
self.print_ident(constraint.ident);
917+
constraint.gen_args.as_ref().map(|args| self.print_generic_args(args, false));
917918
self.s.space();
918919
match &constraint.kind {
919920
ast::AssocTyConstraintKind::Equality { ty } => {

src/test/pretty/gat-bounds.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ impl X for () {
1313
type Y<T> where Self: Sized = u32;
1414
}
1515

16+
fn f<T: X<Y<()> = i32>>() {}
17+
1618
fn main() { }

0 commit comments

Comments
 (0)