@@ -29,16 +29,8 @@ type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
29
29
30
30
type encode_ctxt = { ccx : crate_ctxt , type_abbrevs : abbrev_map } ;
31
31
32
- fn should_inline ( path : ast_map:: path , item: @item) -> bool {
33
- if item. ident == "iter" { // XXX
34
- #debug[ "should_inline(%s::%s)? attrs=%s result=%b" ,
35
- ast_map:: path_to_str ( path) ,
36
- item. ident ,
37
- str:: connect ( vec:: map ( item. attrs , pprust:: attr_to_str) , ", " ) ,
38
- attr:: attrs_contains_name ( item. attrs , "inline" ) ] ;
39
- }
40
-
41
- attr:: attrs_contains_name ( item. attrs , "inline" )
32
+ fn should_inline ( _path : ast_map:: path , attrs : [ attribute ] ) -> bool {
33
+ attr:: attrs_contains_name ( attrs, "inline" )
42
34
}
43
35
44
36
// Path table encoding
@@ -351,7 +343,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
351
343
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, item. id ) ) ;
352
344
encode_symbol ( ecx, ebml_w, item. id ) ;
353
345
encode_path ( ebml_w, path, ast_map:: path_name ( item. ident ) ) ;
354
- if should_inline ( path, item) {
346
+ if should_inline ( path, item. attrs ) {
355
347
astencode:: encode_inlined_item ( ecx, ebml_w, path, ii_item ( item) ) ;
356
348
}
357
349
ebml_w. end_tag ( ) ;
@@ -454,6 +446,11 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
454
446
encode_name ( ebml_w, m. ident ) ;
455
447
encode_symbol ( ecx, ebml_w, m. id ) ;
456
448
encode_path ( ebml_w, impl_path, ast_map:: path_name ( m. ident ) ) ;
449
+ if should_inline ( path, m. attrs ) {
450
+ astencode:: encode_inlined_item (
451
+ ecx, ebml_w, impl_path,
452
+ ii_method ( local_def ( item. id ) , m) ) ;
453
+ }
457
454
ebml_w. end_tag ( ) ;
458
455
}
459
456
}
0 commit comments