@@ -528,11 +528,14 @@ impl unify_methods for infer_ctxt {
528
528
}
529
529
}
530
530
531
- fn flds( a: ty:: field, b: ty:: field) -> ures {
532
- if a. ident != b. ident {
533
- ret self . uerr( ty:: terr_record_fields( a. ident, b. ident) ) ;
531
+ /* mk_subty passes the "smaller" type as the first argument
532
+ and the "bigger" type as the second -- so the first arg
533
+ is the actual type, and the second is the expected type */
534
+ fn flds( a: ty:: field, e: ty:: field) -> ures {
535
+ if e. ident != a. ident {
536
+ ret self . uerr( ty:: terr_record_fields( e. ident, a. ident) ) ;
534
537
}
535
- self . mts( a. mt, b . mt)
538
+ self . mts( a. mt, e . mt)
536
539
}
537
540
538
541
fn tps( as : [ ty:: t] , bs: [ ty:: t] ) -> ures {
@@ -1087,13 +1090,13 @@ fn c_fieldvecs<C:combine>(self: C, as: [ty::field], bs: [ty::field])
1087
1090
}
1088
1091
}
1089
1092
1090
- fn c_flds<C : combine>( self : C , a : ty:: field, b : ty:: field) -> cres<ty:: field> {
1091
- if a . ident == b . ident {
1092
- self . c_mts( a . mt, b . mt) . chain { |mt|
1093
- ok( { ident: a . ident, mt: mt} )
1093
+ fn c_flds<C : combine>( self : C , e : ty:: field, a : ty:: field) -> cres<ty:: field> {
1094
+ if e . ident == a . ident {
1095
+ self . c_mts( e . mt, a . mt) . chain { |mt|
1096
+ ok( { ident: e . ident, mt: mt} )
1094
1097
}
1095
1098
} else {
1096
- err( ty:: terr_record_fields( a . ident, b . ident) )
1099
+ err( ty:: terr_record_fields( e . ident, a . ident) )
1097
1100
}
1098
1101
}
1099
1102
0 commit comments