@@ -20,9 +20,7 @@ use metadata::cstore;
20
20
use metadata:: decoder;
21
21
use metadata:: tyencode;
22
22
use middle:: ty:: { lookup_item_type} ;
23
- use middle:: astencode;
24
23
use middle:: ty;
25
- use middle:: typeck;
26
24
use middle:: stability;
27
25
use middle;
28
26
use util:: nodemap:: { NodeMap , NodeSet } ;
@@ -125,14 +123,6 @@ fn encode_trait_ref(rbml_w: &mut Encoder,
125
123
rbml_w. end_tag ( ) ;
126
124
}
127
125
128
- fn encode_impl_vtables ( rbml_w : & mut Encoder ,
129
- ecx : & EncodeContext ,
130
- vtables : & typeck:: vtable_res ) {
131
- rbml_w. start_tag ( tag_item_impl_vtables) ;
132
- astencode:: encode_vtable_res ( ecx, rbml_w, vtables) ;
133
- rbml_w. end_tag ( ) ;
134
- }
135
-
136
126
// Item info table encoding
137
127
fn encode_family ( rbml_w : & mut Encoder , c : char ) {
138
128
rbml_w. start_tag ( tag_items_data_item_family) ;
@@ -191,6 +181,18 @@ pub fn write_type(ecx: &EncodeContext,
191
181
tyencode:: enc_ty ( rbml_w. writer , ty_str_ctxt, typ) ;
192
182
}
193
183
184
+ pub fn write_trait_ref ( ecx : & EncodeContext ,
185
+ rbml_w : & mut Encoder ,
186
+ trait_ref : & ty:: TraitRef ) {
187
+ let ty_str_ctxt = & tyencode:: ctxt {
188
+ diag : ecx. diag ,
189
+ ds : def_to_string,
190
+ tcx : ecx. tcx ,
191
+ abbrevs : & ecx. type_abbrevs
192
+ } ;
193
+ tyencode:: enc_trait_ref ( rbml_w. writer , ty_str_ctxt, trait_ref) ;
194
+ }
195
+
194
196
pub fn write_region ( ecx : & EncodeContext ,
195
197
rbml_w : & mut Encoder ,
196
198
r : ty:: Region ) {
@@ -399,7 +401,7 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
399
401
let impl_items = ecx. tcx . impl_items . borrow ( ) ;
400
402
match ecx. tcx . inherent_impls . borrow ( ) . find ( & exp. def_id ) {
401
403
Some ( implementations) => {
402
- for base_impl_did in implementations. borrow ( ) . iter ( ) {
404
+ for base_impl_did in implementations. iter ( ) {
403
405
for & method_did in impl_items. get ( base_impl_did) . iter ( ) {
404
406
let impl_item = ty:: impl_or_trait_item (
405
407
ecx. tcx ,
@@ -946,7 +948,7 @@ fn encode_inherent_implementations(ecx: &EncodeContext,
946
948
match ecx. tcx . inherent_impls . borrow ( ) . find ( & def_id) {
947
949
None => { }
948
950
Some ( implementations) => {
949
- for & impl_def_id in implementations. borrow ( ) . iter ( ) {
951
+ for & impl_def_id in implementations. iter ( ) {
950
952
rbml_w. start_tag ( tag_items_data_item_inherent_impl) ;
951
953
encode_def_id ( rbml_w, impl_def_id) ;
952
954
rbml_w. end_tag ( ) ;
@@ -1203,8 +1205,6 @@ fn encode_info_for_item(ecx: &EncodeContext,
1203
1205
let trait_ref = ty:: node_id_to_trait_ref (
1204
1206
tcx, ast_trait_ref. ref_id ) ;
1205
1207
encode_trait_ref ( rbml_w, ecx, & * trait_ref, tag_item_trait_ref) ;
1206
- let impl_vtables = ty:: lookup_impl_vtables ( tcx, def_id) ;
1207
- encode_impl_vtables ( rbml_w, ecx, & impl_vtables) ;
1208
1208
}
1209
1209
encode_path ( rbml_w, path. clone ( ) ) ;
1210
1210
encode_stability ( rbml_w, stab) ;
0 commit comments