Skip to content

Commit 4e6c160

Browse files
committed
---
yaml --- r: 24521 b: refs/heads/try2 c: d52f0f7 h: refs/heads/master i: 24519: 48786d8 v: v3
1 parent daff583 commit 4e6c160

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c854d6ebdb582116e2be0cb2a4a3a4004bc6dce2
8+
refs/heads/try2: d52f0f79bcfd86b689d88a2edfcdb4aafac2e8af
99
refs/heads/incoming: 05543fd04dfb3f63b453a331e239ceb1a9a219f9
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/rustc/middle/typeck/check/vtable.rs

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -115,67 +115,67 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
115115
for list::each(isc) |impls| {
116116
/* For each impl in scope... */
117117
for vec::each(*impls) |im| {
118-
// im = one specific impl
119-
// find the iface that im implements (if any)
120-
let of_ty = alt ty::impl_iface(tcx, im.did) {
121-
some(of_ty) { of_ty }
122-
_ { cont; }
123-
};
118+
// im = one specific impl
119+
// find the iface that im implements (if any)
120+
let of_ty = alt ty::impl_iface(tcx, im.did) {
121+
some(of_ty) { of_ty }
122+
_ { cont; }
123+
};
124124

125-
// it must have the same id as the expected one
126-
alt ty::get(of_ty).struct {
127-
ty::ty_iface(id, _) if id != iface_id { cont; }
128-
_ { /* ok */ }
129-
}
125+
// it must have the same id as the expected one
126+
alt ty::get(of_ty).struct {
127+
ty::ty_iface(id, _) if id != iface_id { cont; }
128+
_ { /* ok */ }
129+
}
130130

131-
// check whether the type unifies with the type
132-
// that the impl is for, and continue if not
133-
let {substs: substs, ty: for_ty} =
134-
impl_self_ty(fcx, im.did);
135-
let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
136-
alt fcx.mk_subty(ty, for_ty) {
137-
result::err(_) { cont; }
138-
result::ok(()) { }
139-
}
131+
// check whether the type unifies with the type
132+
// that the impl is for, and continue if not
133+
let {substs: substs, ty: for_ty} =
134+
impl_self_ty(fcx, im.did);
135+
let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
136+
alt fcx.mk_subty(ty, for_ty) {
137+
result::err(_) { cont; }
138+
result::ok(()) { }
139+
}
140140

141-
// check that desired iface type unifies
142-
#debug("(checking vtable) @2 relating iface ty %s to \
143-
of_ty %s",
144-
fcx.infcx.ty_to_str(iface_ty),
145-
fcx.infcx.ty_to_str(of_ty));
146-
let of_ty = ty::subst(tcx, substs, of_ty);
147-
relate_iface_tys(fcx, sp, iface_ty, of_ty);
141+
// check that desired iface type unifies
142+
#debug("(checking vtable) @2 relating iface ty %s to \
143+
of_ty %s",
144+
fcx.infcx.ty_to_str(iface_ty),
145+
fcx.infcx.ty_to_str(of_ty));
146+
let of_ty = ty::subst(tcx, substs, of_ty);
147+
relate_iface_tys(fcx, sp, iface_ty, of_ty);
148148

149-
// recursively process the bounds
150-
let iface_tps = iface_substs.tps;
151-
let substs_f = fixup_substs(fcx, sp, iface_id, substs);
152-
connect_iface_tps(fcx, sp, substs_f.tps,
153-
iface_tps, im.did);
154-
let subres = lookup_vtables(fcx, isc, sp,
155-
im_bs, substs_f, false);
156-
vec::push(found,
157-
vtable_static(im.did, substs_f.tps, subres));
158-
}
149+
// recursively process the bounds
150+
let iface_tps = iface_substs.tps;
151+
let substs_f = fixup_substs(fcx, sp, iface_id, substs);
152+
connect_iface_tps(fcx, sp, substs_f.tps,
153+
iface_tps, im.did);
154+
let subres = lookup_vtables(fcx, isc, sp,
155+
im_bs, substs_f, false);
156+
vec::push(found,
157+
vtable_static(im.did, substs_f.tps, subres));
158+
}
159159

160-
alt found.len() {
161-
0u { /* fallthrough */ }
162-
1u { ret found[0]; }
163-
_ {
164-
fcx.ccx.tcx.sess.span_err(
165-
sp, "multiple applicable methods in scope");
166-
ret found[0];
167-
}
168-
}
160+
alt found.len() {
161+
0u { /* fallthrough */ }
162+
1u { ret found[0]; }
163+
_ {
164+
fcx.ccx.tcx.sess.span_err(
165+
sp, "multiple applicable methods in scope");
166+
ret found[0];
167+
}
169168
}
170-
}
171169
}
172-
173-
tcx.sess.span_fatal(
174-
sp, "failed to find an implementation of interface " +
175-
ty_to_str(tcx, iface_ty) + " for " +
176-
ty_to_str(tcx, ty));
170+
}
177171
}
178172

173+
tcx.sess.span_fatal(
174+
sp, "failed to find an implementation of interface " +
175+
ty_to_str(tcx, iface_ty) + " for " +
176+
ty_to_str(tcx, ty));
177+
}
178+
179179
fn fixup_ty(fcx: @fn_ctxt, sp: span, ty: ty::t) -> ty::t {
180180
let tcx = fcx.ccx.tcx;
181181
alt infer::resolve_deep(fcx.infcx, ty, force_all) {

0 commit comments

Comments
 (0)