@@ -840,7 +840,7 @@ fn encode_method_ty_fields(ecx: &EncodeContext,
840
840
ty:: StaticExplicitSelfCategory => {
841
841
encode_family ( rbml_w, fn_style_static_method_family ( fn_style) ) ;
842
842
}
843
- _ => encode_family ( rbml_w, style_fn_family ( fn_style) )
843
+ _ => encode_family ( rbml_w, fn_style_method_family ( fn_style) )
844
844
}
845
845
encode_provided_source ( rbml_w, method_ty. provided_source ) ;
846
846
}
@@ -978,6 +978,13 @@ fn fn_style_static_method_family(s: FnStyle) -> char {
978
978
}
979
979
}
980
980
981
+ fn fn_style_method_family ( s : FnStyle ) -> char {
982
+ match s {
983
+ UnsafeFn => 'h' ,
984
+ NormalFn => 'H' ,
985
+ }
986
+ }
987
+
981
988
982
989
fn should_inline ( attrs : & [ Attribute ] ) -> bool {
983
990
use syntax:: attr:: * ;
@@ -1407,7 +1414,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
1407
1414
}
1408
1415
_ => {
1409
1416
encode_family ( rbml_w,
1410
- style_fn_family (
1417
+ fn_style_method_family (
1411
1418
method_ty. fty . fn_style ) ) ;
1412
1419
}
1413
1420
}
@@ -1432,30 +1439,30 @@ fn encode_info_for_item(ecx: &EncodeContext,
1432
1439
encode_parent_sort ( rbml_w, 't' ) ;
1433
1440
1434
1441
let trait_item = & ms[ i] ;
1435
- match & ms[ i] {
1436
- & RequiredMethod ( ref tm) => {
1437
- encode_attributes ( rbml_w, tm. attrs . as_slice ( ) ) ;
1442
+ let foo = |rbml_w : & mut Encoder | {
1443
+ // If this is a static method, we've already
1444
+ // encoded this.
1445
+ if is_nonstatic_method {
1446
+ // FIXME: I feel like there is something funny
1447
+ // going on.
1448
+ let pty = ty:: lookup_item_type ( tcx, item_def_id. def_id ( ) ) ;
1449
+ encode_bounds_and_type ( rbml_w, ecx, & pty) ;
1450
+ }
1451
+ } ;
1452
+ match trait_item {
1453
+ & RequiredMethod ( ref m) => {
1454
+ encode_attributes ( rbml_w, m. attrs . as_slice ( ) ) ;
1455
+ foo ( rbml_w) ;
1438
1456
encode_item_sort ( rbml_w, 'r' ) ;
1439
- encode_method_argument_names ( rbml_w, & * tm . decl ) ;
1457
+ encode_method_argument_names ( rbml_w, & * m . decl ) ;
1440
1458
}
1441
1459
1442
1460
& ProvidedMethod ( ref m) => {
1443
1461
encode_attributes ( rbml_w, m. attrs . as_slice ( ) ) ;
1444
- // If this is a static method, we've already
1445
- // encoded this.
1446
- if is_nonstatic_method {
1447
- // FIXME: I feel like there is something funny
1448
- // going on.
1449
- let pty = ty:: lookup_item_type ( tcx,
1450
- item_def_id. def_id ( ) ) ;
1451
- encode_bounds_and_type ( rbml_w, ecx, & pty) ;
1452
- }
1462
+ foo ( rbml_w) ;
1453
1463
encode_item_sort ( rbml_w, 'p' ) ;
1454
- encode_inlined_item ( ecx,
1455
- rbml_w,
1456
- IITraitItemRef ( def_id, trait_item) ) ;
1457
- encode_method_argument_names ( rbml_w,
1458
- & * m. pe_fn_decl ( ) ) ;
1464
+ encode_inlined_item ( ecx, rbml_w, IITraitItemRef ( def_id, trait_item) ) ;
1465
+ encode_method_argument_names ( rbml_w, & * m. pe_fn_decl ( ) ) ;
1459
1466
}
1460
1467
1461
1468
& TypeTraitItem ( ref associated_type) => {
0 commit comments