@@ -33,8 +33,8 @@ pub struct StaticMethodInfo {
33
33
}
34
34
35
35
pub fn get_symbol ( cstore : & cstore:: CStore , def : ast:: DefId ) -> ~str {
36
- let cdata = cstore. get_crate_data ( def. krate ) . data ( ) ;
37
- return decoder:: get_symbol ( cdata, def. node ) ;
36
+ let cdata = cstore. get_crate_data ( def. krate ) ;
37
+ decoder:: get_symbol ( cdata. data ( ) , def. node )
38
38
}
39
39
40
40
/// Iterates over all the language items in the given crate.
@@ -43,7 +43,7 @@ pub fn each_lang_item(cstore: &cstore::CStore,
43
43
f : |ast:: NodeId , uint| -> bool)
44
44
-> bool {
45
45
let crate_data = cstore. get_crate_data ( cnum) ;
46
- decoder:: each_lang_item ( crate_data, f)
46
+ decoder:: each_lang_item ( & * crate_data, f)
47
47
}
48
48
49
49
/// Iterates over each child of the given item.
@@ -57,7 +57,7 @@ pub fn each_child_of_item(cstore: &cstore::CStore,
57
57
cstore. get_crate_data ( cnum)
58
58
} ;
59
59
decoder:: each_child_of_item ( cstore. intr . clone ( ) ,
60
- crate_data,
60
+ & * crate_data,
61
61
def_id. node ,
62
62
get_crate_data,
63
63
callback)
@@ -74,15 +74,15 @@ pub fn each_top_level_item_of_crate(cstore: &cstore::CStore,
74
74
cstore. get_crate_data ( cnum)
75
75
} ;
76
76
decoder:: each_top_level_item_of_crate ( cstore. intr . clone ( ) ,
77
- crate_data,
77
+ & * crate_data,
78
78
get_crate_data,
79
79
callback)
80
80
}
81
81
82
82
pub fn get_item_path ( tcx : & ty:: ctxt , def : ast:: DefId ) -> Vec < ast_map:: PathElem > {
83
83
let cstore = & tcx. sess . cstore ;
84
84
let cdata = cstore. get_crate_data ( def. krate ) ;
85
- let path = decoder:: get_item_path ( cdata, def. node ) ;
85
+ let path = decoder:: get_item_path ( & * cdata, def. node ) ;
86
86
87
87
// FIXME #1920: This path is not always correct if the crate is not linked
88
88
// into the root namespace.
@@ -103,101 +103,101 @@ pub fn maybe_get_item_ast(tcx: &ty::ctxt, def: ast::DefId,
103
103
-> found_ast {
104
104
let cstore = & tcx. sess . cstore ;
105
105
let cdata = cstore. get_crate_data ( def. krate ) ;
106
- decoder:: maybe_get_item_ast ( cdata, tcx, def. node , decode_inlined_item)
106
+ decoder:: maybe_get_item_ast ( & * cdata, tcx, def. node , decode_inlined_item)
107
107
}
108
108
109
109
pub fn get_enum_variants ( tcx : & ty:: ctxt , def : ast:: DefId )
110
110
-> Vec < @ty:: VariantInfo > {
111
111
let cstore = & tcx. sess . cstore ;
112
112
let cdata = cstore. get_crate_data ( def. krate ) ;
113
- return decoder:: get_enum_variants ( cstore. intr . clone ( ) , cdata, def. node , tcx)
113
+ return decoder:: get_enum_variants ( cstore. intr . clone ( ) , & * cdata, def. node , tcx)
114
114
}
115
115
116
116
/// Returns information about the given implementation.
117
117
pub fn get_impl ( tcx : & ty:: ctxt , impl_def_id : ast:: DefId )
118
118
-> ty:: Impl {
119
119
let cdata = tcx. sess . cstore . get_crate_data ( impl_def_id. krate ) ;
120
- decoder:: get_impl ( tcx. sess . cstore . intr . clone ( ) , cdata, impl_def_id. node , tcx)
120
+ decoder:: get_impl ( tcx. sess . cstore . intr . clone ( ) , & * cdata, impl_def_id. node , tcx)
121
121
}
122
122
123
123
pub fn get_method ( tcx : & ty:: ctxt , def : ast:: DefId ) -> ty:: Method {
124
124
let cdata = tcx. sess . cstore . get_crate_data ( def. krate ) ;
125
- decoder:: get_method ( tcx. sess . cstore . intr . clone ( ) , cdata, def. node , tcx)
125
+ decoder:: get_method ( tcx. sess . cstore . intr . clone ( ) , & * cdata, def. node , tcx)
126
126
}
127
127
128
128
pub fn get_method_name_and_explicit_self ( cstore : & cstore:: CStore ,
129
129
def : ast:: DefId )
130
130
-> ( ast:: Ident , ast:: ExplicitSelf_ )
131
131
{
132
132
let cdata = cstore. get_crate_data ( def. krate ) ;
133
- decoder:: get_method_name_and_explicit_self ( cstore. intr . clone ( ) , cdata, def. node )
133
+ decoder:: get_method_name_and_explicit_self ( cstore. intr . clone ( ) , & * cdata, def. node )
134
134
}
135
135
136
136
pub fn get_trait_method_def_ids ( cstore : & cstore:: CStore ,
137
137
def : ast:: DefId ) -> Vec < ast:: DefId > {
138
138
let cdata = cstore. get_crate_data ( def. krate ) ;
139
- decoder:: get_trait_method_def_ids ( cdata, def. node )
139
+ decoder:: get_trait_method_def_ids ( & * cdata, def. node )
140
140
}
141
141
142
142
pub fn get_item_variances ( cstore : & cstore:: CStore ,
143
143
def : ast:: DefId ) -> ty:: ItemVariances {
144
144
let cdata = cstore. get_crate_data ( def. krate ) ;
145
- decoder:: get_item_variances ( cdata, def. node )
145
+ decoder:: get_item_variances ( & * cdata, def. node )
146
146
}
147
147
148
148
pub fn get_provided_trait_methods ( tcx : & ty:: ctxt ,
149
149
def : ast:: DefId )
150
150
-> Vec < @ty:: Method > {
151
151
let cstore = & tcx. sess . cstore ;
152
152
let cdata = cstore. get_crate_data ( def. krate ) ;
153
- decoder:: get_provided_trait_methods ( cstore. intr . clone ( ) , cdata, def. node , tcx)
153
+ decoder:: get_provided_trait_methods ( cstore. intr . clone ( ) , & * cdata, def. node , tcx)
154
154
}
155
155
156
156
pub fn get_supertraits ( tcx : & ty:: ctxt , def : ast:: DefId ) -> Vec < @ty:: TraitRef > {
157
157
let cstore = & tcx. sess . cstore ;
158
158
let cdata = cstore. get_crate_data ( def. krate ) ;
159
- decoder:: get_supertraits ( cdata, def. node , tcx)
159
+ decoder:: get_supertraits ( & * cdata, def. node , tcx)
160
160
}
161
161
162
162
pub fn get_type_name_if_impl ( cstore : & cstore:: CStore , def : ast:: DefId )
163
163
-> Option < ast:: Ident > {
164
164
let cdata = cstore. get_crate_data ( def. krate ) ;
165
- decoder:: get_type_name_if_impl ( cdata, def. node )
165
+ decoder:: get_type_name_if_impl ( & * cdata, def. node )
166
166
}
167
167
168
168
pub fn get_static_methods_if_impl ( cstore : & cstore:: CStore ,
169
169
def : ast:: DefId )
170
170
-> Option < Vec < StaticMethodInfo > > {
171
171
let cdata = cstore. get_crate_data ( def. krate ) ;
172
- decoder:: get_static_methods_if_impl ( cstore. intr . clone ( ) , cdata, def. node )
172
+ decoder:: get_static_methods_if_impl ( cstore. intr . clone ( ) , & * cdata, def. node )
173
173
}
174
174
175
175
pub fn get_item_attrs ( cstore : & cstore:: CStore ,
176
176
def_id : ast:: DefId ,
177
177
f: |Vec < @ast:: MetaItem > |) {
178
178
let cdata = cstore. get_crate_data ( def_id. krate ) ;
179
- decoder:: get_item_attrs ( cdata, def_id. node , f)
179
+ decoder:: get_item_attrs ( & * cdata, def_id. node , f)
180
180
}
181
181
182
182
pub fn get_struct_fields ( cstore : & cstore:: CStore ,
183
183
def : ast:: DefId )
184
184
-> Vec < ty:: field_ty > {
185
185
let cdata = cstore. get_crate_data ( def. krate ) ;
186
- decoder:: get_struct_fields ( cstore. intr . clone ( ) , cdata, def. node )
186
+ decoder:: get_struct_fields ( cstore. intr . clone ( ) , & * cdata, def. node )
187
187
}
188
188
189
189
pub fn get_type ( tcx : & ty:: ctxt ,
190
190
def : ast:: DefId )
191
191
-> ty:: ty_param_bounds_and_ty {
192
192
let cstore = & tcx. sess . cstore ;
193
193
let cdata = cstore. get_crate_data ( def. krate ) ;
194
- decoder:: get_type ( cdata, def. node , tcx)
194
+ decoder:: get_type ( & * cdata, def. node , tcx)
195
195
}
196
196
197
197
pub fn get_trait_def ( tcx : & ty:: ctxt , def : ast:: DefId ) -> ty:: TraitDef {
198
198
let cstore = & tcx. sess . cstore ;
199
199
let cdata = cstore. get_crate_data ( def. krate ) ;
200
- decoder:: get_trait_def ( cdata, def. node , tcx)
200
+ decoder:: get_trait_def ( & * cdata, def. node , tcx)
201
201
}
202
202
203
203
pub fn get_field_type ( tcx : & ty:: ctxt , class_id : ast:: DefId ,
@@ -213,7 +213,7 @@ pub fn get_field_type(tcx: &ty::ctxt, class_id: ast::DefId,
213
213
decoder:: maybe_find_item ( def. node , class_doc) ,
214
214
|| format ! ( "get_field_type: in class {:?}, field ID {:?} not found" ,
215
215
class_id, def) ) ;
216
- let ty = decoder:: item_type ( def, the_field, tcx, cdata) ;
216
+ let ty = decoder:: item_type ( def, the_field, tcx, & * cdata) ;
217
217
ty:: ty_param_bounds_and_ty {
218
218
generics : ty:: Generics { type_param_defs : Rc :: new ( Vec :: new ( ) ) ,
219
219
region_param_defs : Rc :: new ( Vec :: new ( ) ) } ,
@@ -227,43 +227,43 @@ pub fn get_impl_trait(tcx: &ty::ctxt,
227
227
def : ast:: DefId ) -> Option < @ty:: TraitRef > {
228
228
let cstore = & tcx. sess . cstore ;
229
229
let cdata = cstore. get_crate_data ( def. krate ) ;
230
- decoder:: get_impl_trait ( cdata, def. node , tcx)
230
+ decoder:: get_impl_trait ( & * cdata, def. node , tcx)
231
231
}
232
232
233
233
// Given a def_id for an impl, return information about its vtables
234
234
pub fn get_impl_vtables ( tcx : & ty:: ctxt ,
235
235
def : ast:: DefId ) -> typeck:: impl_res {
236
236
let cstore = & tcx. sess . cstore ;
237
237
let cdata = cstore. get_crate_data ( def. krate ) ;
238
- decoder:: get_impl_vtables ( cdata, def. node , tcx)
238
+ decoder:: get_impl_vtables ( & * cdata, def. node , tcx)
239
239
}
240
240
241
241
pub fn get_native_libraries ( cstore : & cstore:: CStore ,
242
242
crate_num : ast:: CrateNum )
243
243
-> Vec < ( cstore:: NativeLibaryKind , ~str ) > {
244
244
let cdata = cstore. get_crate_data ( crate_num) ;
245
- decoder:: get_native_libraries ( cdata)
245
+ decoder:: get_native_libraries ( & * cdata)
246
246
}
247
247
248
248
pub fn each_impl ( cstore : & cstore:: CStore ,
249
249
crate_num : ast:: CrateNum ,
250
250
callback: |ast:: DefId |) {
251
251
let cdata = cstore. get_crate_data ( crate_num) ;
252
- decoder:: each_impl ( cdata, callback)
252
+ decoder:: each_impl ( & * cdata, callback)
253
253
}
254
254
255
255
pub fn each_implementation_for_type ( cstore : & cstore:: CStore ,
256
256
def_id : ast:: DefId ,
257
257
callback: |ast:: DefId |) {
258
258
let cdata = cstore. get_crate_data ( def_id. krate ) ;
259
- decoder:: each_implementation_for_type ( cdata, def_id. node , callback)
259
+ decoder:: each_implementation_for_type ( & * cdata, def_id. node , callback)
260
260
}
261
261
262
262
pub fn each_implementation_for_trait ( cstore : & cstore:: CStore ,
263
263
def_id : ast:: DefId ,
264
264
callback: |ast:: DefId |) {
265
265
let cdata = cstore. get_crate_data ( def_id. krate ) ;
266
- decoder:: each_implementation_for_trait ( cdata, def_id. node , callback)
266
+ decoder:: each_implementation_for_trait ( & * cdata, def_id. node , callback)
267
267
}
268
268
269
269
/// If the given def ID describes a method belonging to a trait (either a
@@ -274,27 +274,27 @@ pub fn get_trait_of_method(cstore: &cstore::CStore,
274
274
tcx : & ty:: ctxt )
275
275
-> Option < ast:: DefId > {
276
276
let cdata = cstore. get_crate_data ( def_id. krate ) ;
277
- decoder:: get_trait_of_method ( cdata, def_id. node , tcx)
277
+ decoder:: get_trait_of_method ( & * cdata, def_id. node , tcx)
278
278
}
279
279
280
280
pub fn get_macro_registrar_fn ( cstore : & cstore:: CStore ,
281
281
crate_num : ast:: CrateNum )
282
282
-> Option < ast:: NodeId > {
283
283
let cdata = cstore. get_crate_data ( crate_num) ;
284
- decoder:: get_macro_registrar_fn ( cdata)
284
+ decoder:: get_macro_registrar_fn ( & * cdata)
285
285
}
286
286
287
287
pub fn get_exported_macros ( cstore : & cstore:: CStore ,
288
288
crate_num : ast:: CrateNum )
289
289
-> Vec < ~str > {
290
290
let cdata = cstore. get_crate_data ( crate_num) ;
291
- decoder:: get_exported_macros ( cdata)
291
+ decoder:: get_exported_macros ( & * cdata)
292
292
}
293
293
294
294
pub fn get_tuple_struct_definition_if_ctor ( cstore : & cstore:: CStore ,
295
295
def_id : ast:: DefId )
296
296
-> Option < ast:: DefId >
297
297
{
298
298
let cdata = cstore. get_crate_data ( def_id. krate ) ;
299
- decoder:: get_tuple_struct_definition_if_ctor ( cdata, def_id. node )
299
+ decoder:: get_tuple_struct_definition_if_ctor ( & * cdata, def_id. node )
300
300
}
0 commit comments