File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1416,14 +1416,18 @@ impl Ty {
14161416 Self :: GenericParam { name } => write ! ( f, "{name}" ) ,
14171417 Self :: AnyObject { protocols } => match & * * protocols {
14181418 [ ] => write ! ( f, "AnyObject" ) ,
1419- [ decl] => write ! ( f, "ProtocolObject<dyn {}>" , decl. id. path( ) ) ,
1420- // TODO: Handle this better
1421- [ first, rest @ ..] => {
1422- write ! ( f, "AnyObject /* {}" , first. id. path( ) ) ?;
1423- for protocol in rest {
1424- write ! ( f, "+ {}" , protocol. id. path( ) ) ?;
1419+ protocols => {
1420+ write ! ( f, "ProtocolObject<dyn " ) ?;
1421+
1422+ let mut iter = protocols. iter ( ) ;
1423+ let protocol = iter. next ( ) . unwrap ( ) ;
1424+ write ! ( f, "{}" , protocol. path( ) ) ?;
1425+
1426+ for protocol in iter {
1427+ write ! ( f, " + {}" , protocol. path( ) ) ?;
14251428 }
1426- write ! ( f, " */" ) ?;
1429+
1430+ write ! ( f, ">" ) ?;
14271431 Ok ( ( ) )
14281432 }
14291433 } ,
You can’t perform that action at this time.
0 commit comments