@@ -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 } ;
@@ -130,14 +128,6 @@ fn encode_trait_ref(rbml_w: &mut Encoder,
130
128
rbml_w. end_tag ( ) ;
131
129
}
132
130
133
- fn encode_impl_vtables ( rbml_w : & mut Encoder ,
134
- ecx : & EncodeContext ,
135
- vtables : & typeck:: vtable_res ) {
136
- rbml_w. start_tag ( tag_item_impl_vtables) ;
137
- astencode:: encode_vtable_res ( ecx, rbml_w, vtables) ;
138
- rbml_w. end_tag ( ) ;
139
- }
140
-
141
131
// Item info table encoding
142
132
fn encode_family ( rbml_w : & mut Encoder , c : char ) {
143
133
rbml_w. start_tag ( tag_items_data_item_family) ;
@@ -196,6 +186,18 @@ pub fn write_type(ecx: &EncodeContext,
196
186
tyencode:: enc_ty ( rbml_w. writer , ty_str_ctxt, typ) ;
197
187
}
198
188
189
+ pub fn write_trait_ref ( ecx : & EncodeContext ,
190
+ rbml_w : & mut Encoder ,
191
+ trait_ref : & ty:: TraitRef ) {
192
+ let ty_str_ctxt = & tyencode:: ctxt {
193
+ diag : ecx. diag ,
194
+ ds : def_to_string,
195
+ tcx : ecx. tcx ,
196
+ abbrevs : & ecx. type_abbrevs
197
+ } ;
198
+ tyencode:: enc_trait_ref ( rbml_w. writer , ty_str_ctxt, trait_ref) ;
199
+ }
200
+
199
201
pub fn write_region ( ecx : & EncodeContext ,
200
202
rbml_w : & mut Encoder ,
201
203
r : ty:: Region ) {
@@ -404,7 +406,7 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
404
406
let impl_items = ecx. tcx . impl_items . borrow ( ) ;
405
407
match ecx. tcx . inherent_impls . borrow ( ) . find ( & exp. def_id ) {
406
408
Some ( implementations) => {
407
- for base_impl_did in implementations. borrow ( ) . iter ( ) {
409
+ for base_impl_did in implementations. iter ( ) {
408
410
for & method_did in impl_items. get ( base_impl_did) . iter ( ) {
409
411
let impl_item = ty:: impl_or_trait_item (
410
412
ecx. tcx ,
@@ -957,7 +959,7 @@ fn encode_inherent_implementations(ecx: &EncodeContext,
957
959
match ecx. tcx . inherent_impls . borrow ( ) . find ( & def_id) {
958
960
None => { }
959
961
Some ( implementations) => {
960
- for & impl_def_id in implementations. borrow ( ) . iter ( ) {
962
+ for & impl_def_id in implementations. iter ( ) {
961
963
rbml_w. start_tag ( tag_items_data_item_inherent_impl) ;
962
964
encode_def_id ( rbml_w, impl_def_id) ;
963
965
rbml_w. end_tag ( ) ;
@@ -1214,8 +1216,6 @@ fn encode_info_for_item(ecx: &EncodeContext,
1214
1216
let trait_ref = ty:: node_id_to_trait_ref (
1215
1217
tcx, ast_trait_ref. ref_id ) ;
1216
1218
encode_trait_ref ( rbml_w, ecx, & * trait_ref, tag_item_trait_ref) ;
1217
- let impl_vtables = ty:: lookup_impl_vtables ( tcx, def_id) ;
1218
- encode_impl_vtables ( rbml_w, ecx, & impl_vtables) ;
1219
1219
}
1220
1220
encode_path ( rbml_w, path. clone ( ) ) ;
1221
1221
encode_stability ( rbml_w, stab) ;
0 commit comments