@@ -618,13 +618,12 @@ fn encode_visibility(rbml_w: &mut Encoder, visibility: ast::Visibility) {
618
618
rbml_w. end_tag ( ) ;
619
619
}
620
620
621
- fn encode_unboxed_closure_kind ( rbml_w : & mut Encoder ,
622
- kind : ty:: UnboxedClosureKind ) {
623
- rbml_w. start_tag ( tag_unboxed_closure_kind) ;
621
+ fn encode_closure_kind ( rbml_w : & mut Encoder , kind : ty:: ClosureKind ) {
622
+ rbml_w. start_tag ( tag_closure_kind) ;
624
623
let ch = match kind {
625
- ty:: FnUnboxedClosureKind => 'f' ,
626
- ty:: FnMutUnboxedClosureKind => 'm' ,
627
- ty:: FnOnceUnboxedClosureKind => 'o' ,
624
+ ty:: FnClosureKind => 'f' ,
625
+ ty:: FnMutClosureKind => 'm' ,
626
+ ty:: FnOnceClosureKind => 'o' ,
628
627
} ;
629
628
rbml_w. wr_str ( & ch. to_string ( ) [ ] ) ;
630
629
rbml_w. end_tag ( ) ;
@@ -1838,24 +1837,19 @@ fn encode_macro_defs(rbml_w: &mut Encoder,
1838
1837
rbml_w. end_tag ( ) ;
1839
1838
}
1840
1839
1841
- fn encode_unboxed_closures < ' a > (
1842
- ecx : & ' a EncodeContext ,
1843
- rbml_w : & ' a mut Encoder ) {
1844
- rbml_w. start_tag ( tag_unboxed_closures) ;
1845
- for ( unboxed_closure_id, unboxed_closure) in ecx. tcx
1846
- . unboxed_closures
1847
- . borrow ( )
1848
- . iter ( ) {
1849
- if unboxed_closure_id. krate != ast:: LOCAL_CRATE {
1840
+ fn encode_closures < ' a > ( ecx : & ' a EncodeContext , rbml_w : & ' a mut Encoder ) {
1841
+ rbml_w. start_tag ( tag_closures) ;
1842
+ for ( closure_id, closure) in ecx. tcx . closures . borrow ( ) . iter ( ) {
1843
+ if closure_id. krate != ast:: LOCAL_CRATE {
1850
1844
continue
1851
1845
}
1852
1846
1853
- rbml_w. start_tag ( tag_unboxed_closure ) ;
1854
- encode_def_id ( rbml_w, * unboxed_closure_id ) ;
1855
- rbml_w. start_tag ( tag_unboxed_closure_type ) ;
1856
- write_closure_type ( ecx, rbml_w, & unboxed_closure . closure_type ) ;
1847
+ rbml_w. start_tag ( tag_closure ) ;
1848
+ encode_def_id ( rbml_w, * closure_id ) ;
1849
+ rbml_w. start_tag ( tag_closure_type ) ;
1850
+ write_closure_type ( ecx, rbml_w, & closure . closure_type ) ;
1857
1851
rbml_w. end_tag ( ) ;
1858
- encode_unboxed_closure_kind ( rbml_w, unboxed_closure . kind ) ;
1852
+ encode_closure_kind ( rbml_w, closure . kind ) ;
1859
1853
rbml_w. end_tag ( ) ;
1860
1854
}
1861
1855
rbml_w. end_tag ( ) ;
@@ -2069,7 +2063,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2069
2063
native_lib_bytes : u64 ,
2070
2064
plugin_registrar_fn_bytes : u64 ,
2071
2065
macro_defs_bytes : u64 ,
2072
- unboxed_closure_bytes : u64 ,
2066
+ closure_bytes : u64 ,
2073
2067
impl_bytes : u64 ,
2074
2068
misc_bytes : u64 ,
2075
2069
item_bytes : u64 ,
@@ -2084,7 +2078,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2084
2078
native_lib_bytes : 0 ,
2085
2079
plugin_registrar_fn_bytes : 0 ,
2086
2080
macro_defs_bytes : 0 ,
2087
- unboxed_closure_bytes : 0 ,
2081
+ closure_bytes : 0 ,
2088
2082
impl_bytes : 0 ,
2089
2083
misc_bytes : 0 ,
2090
2084
item_bytes : 0 ,
@@ -2154,10 +2148,10 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2154
2148
encode_macro_defs ( & mut rbml_w, krate) ;
2155
2149
stats. macro_defs_bytes = rbml_w. writer . tell ( ) . unwrap ( ) - i;
2156
2150
2157
- // Encode the types of all unboxed closures in this crate.
2151
+ // Encode the types of all closures in this crate.
2158
2152
i = rbml_w. writer . tell ( ) . unwrap ( ) ;
2159
- encode_unboxed_closures ( & ecx, & mut rbml_w) ;
2160
- stats. unboxed_closure_bytes = rbml_w. writer . tell ( ) . unwrap ( ) - i;
2153
+ encode_closures ( & ecx, & mut rbml_w) ;
2154
+ stats. closure_bytes = rbml_w. writer . tell ( ) . unwrap ( ) - i;
2161
2155
2162
2156
// Encode the def IDs of impls, for coherence checking.
2163
2157
i = rbml_w. writer . tell ( ) . unwrap ( ) ;
@@ -2199,7 +2193,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2199
2193
println ! ( " native bytes: {}" , stats. native_lib_bytes) ;
2200
2194
println ! ( "plugin registrar bytes: {}" , stats. plugin_registrar_fn_bytes) ;
2201
2195
println ! ( " macro def bytes: {}" , stats. macro_defs_bytes) ;
2202
- println ! ( " unboxed closure bytes: {}" , stats. unboxed_closure_bytes ) ;
2196
+ println ! ( " closure bytes: {}" , stats. closure_bytes ) ;
2203
2197
println ! ( " impl bytes: {}" , stats. impl_bytes) ;
2204
2198
println ! ( " misc bytes: {}" , stats. misc_bytes) ;
2205
2199
println ! ( " item bytes: {}" , stats. item_bytes) ;
0 commit comments