File tree 2 files changed +8
-17
lines changed
2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -1239,13 +1239,13 @@ impl fmt::Debug for OwnerNodes<'_> {
1239
1239
. field ( "node" , & self . nodes [ ItemLocalId :: ZERO ] )
1240
1240
. field (
1241
1241
"parents" ,
1242
- & self
1243
- . nodes
1244
- . iter_enumerated ( )
1245
- . map ( | ( id , parented_node ) | {
1246
- debug_fn ( move |f| write ! ( f , "({id:?}, {:?})" , parented_node . parent ) )
1247
- } )
1248
- . collect :: < Vec < _ > > ( ) ,
1242
+ & fmt :: from_fn ( |f| {
1243
+ f . debug_list ( )
1244
+ . entries ( self . nodes . iter_enumerated ( ) . map ( | ( id , parented_node ) | {
1245
+ fmt :: from_fn ( move |f| write ! ( f , "({id:?}, {:?})" , parented_node . parent ) )
1246
+ } ) )
1247
+ . finish ( )
1248
+ } ) ,
1249
1249
)
1250
1250
. field ( "bodies" , & self . bodies )
1251
1251
. field ( "opt_hash_including_bodies" , & self . opt_hash_including_bodies )
@@ -4527,13 +4527,3 @@ mod size_asserts {
4527
4527
static_assert_size ! ( TyKind <' _>, 32 ) ;
4528
4528
// tidy-alphabetical-end
4529
4529
}
4530
-
4531
- fn debug_fn ( f : impl Fn ( & mut fmt:: Formatter < ' _ > ) -> fmt:: Result ) -> impl fmt:: Debug {
4532
- struct DebugFn < F > ( F ) ;
4533
- impl < F : Fn ( & mut fmt:: Formatter < ' _ > ) -> fmt:: Result > fmt:: Debug for DebugFn < F > {
4534
- fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
4535
- ( self . 0 ) ( fmt)
4536
- }
4537
- }
4538
- DebugFn ( f)
4539
- }
Original file line number Diff line number Diff line change 6
6
#![ allow( internal_features) ]
7
7
#![ feature( associated_type_defaults) ]
8
8
#![ feature( closure_track_caller) ]
9
+ #![ feature( debug_closure_helpers) ]
9
10
#![ feature( let_chains) ]
10
11
#![ feature( never_type) ]
11
12
#![ feature( rustc_attrs) ]
You can’t perform that action at this time.
0 commit comments