Skip to content

Commit 6949e72

Browse files
committed
---
yaml --- r: 15333 b: refs/heads/try c: 5a3875e h: refs/heads/master i: 15331: e622a41 v: v3
1 parent ed0c307 commit 6949e72

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 3ef620bf927bd1caf1cdf2b902d37678ed5bb167
5+
refs/heads/try: 5a3875e998ad2583978bfc8f0e6d1533b10fbea4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/infer.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,14 @@ impl unify_methods for infer_ctxt {
528528
}
529529
}
530530

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));
534537
}
535-
self.mts(a.mt, b.mt)
538+
self.mts(a.mt, e.mt)
536539
}
537540

538541
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])
10871090
}
10881091
}
10891092

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})
10941097
}
10951098
} else {
1096-
err(ty::terr_record_fields(a.ident, b.ident))
1099+
err(ty::terr_record_fields(e.ident, a.ident))
10971100
}
10981101
}
10991102

0 commit comments

Comments
 (0)