File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 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<'_> {
12391239 . field ( "node" , & self . nodes [ ItemLocalId :: ZERO ] )
12401240 . field (
12411241 "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+ } ) ,
12491249 )
12501250 . field ( "bodies" , & self . bodies )
12511251 . field ( "opt_hash_including_bodies" , & self . opt_hash_including_bodies )
@@ -4527,13 +4527,3 @@ mod size_asserts {
45274527 static_assert_size ! ( TyKind <' _>, 32 ) ;
45284528 // tidy-alphabetical-end
45294529}
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 66#![ allow( internal_features) ]
77#![ feature( associated_type_defaults) ]
88#![ feature( closure_track_caller) ]
9+ #![ feature( debug_closure_helpers) ]
910#![ feature( let_chains) ]
1011#![ feature( never_type) ]
1112#![ feature( rustc_attrs) ]
You can’t perform that action at this time.
0 commit comments