about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2012-07-03 10:57:17 -0700
committerMichael Sullivan <sully@msully.net>2012-07-03 10:57:17 -0700
commitd52f0f79bcfd86b689d88a2edfcdb4aafac2e8af (patch)
tree65aebe4ec4afbe1cc9fced51bc709d462a08e59d /src
parentc854d6ebdb582116e2be0cb2a4a3a4004bc6dce2 (diff)
Fix some indentation in check::vtable.
Diffstat (limited to 'src')
-rw-r--r--src/rustc/middle/typeck/check/vtable.rs104
1 files changed, 52 insertions, 52 deletions
diff --git a/src/rustc/middle/typeck/check/vtable.rs b/src/rustc/middle/typeck/check/vtable.rs
index 144953db226..d410369c2ed 100644
--- a/src/rustc/middle/typeck/check/vtable.rs
+++ b/src/rustc/middle/typeck/check/vtable.rs
@@ -115,67 +115,67 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
         for list::each(isc) |impls| {
             /* For each impl in scope... */
             for vec::each(*impls) |im| {
-                    // im = one specific impl
-                    // find the iface that im implements (if any)
-                    let of_ty = alt ty::impl_iface(tcx, im.did) {
-                      some(of_ty) { of_ty }
-                      _ { cont; }
-                    };
+                // im = one specific impl
+                // find the iface that im implements (if any)
+                let of_ty = alt ty::impl_iface(tcx, im.did) {
+                  some(of_ty) { of_ty }
+                  _ { cont; }
+                };
 
-                    // it must have the same id as the expected one
-                    alt ty::get(of_ty).struct {
-                      ty::ty_iface(id, _) if id != iface_id { cont; }
-                      _ { /* ok */ }
-                    }
+                // it must have the same id as the expected one
+                alt ty::get(of_ty).struct {
+                  ty::ty_iface(id, _) if id != iface_id { cont; }
+                  _ { /* ok */ }
+                }
 
-                    // check whether the type unifies with the type
-                    // that the impl is for, and continue if not
-                    let {substs: substs, ty: for_ty} =
-                        impl_self_ty(fcx, im.did);
-                    let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
-                    alt fcx.mk_subty(ty, for_ty) {
-                      result::err(_) { cont; }
-                      result::ok(()) { }
-                    }
+                // check whether the type unifies with the type
+                // that the impl is for, and continue if not
+                let {substs: substs, ty: for_ty} =
+                    impl_self_ty(fcx, im.did);
+                let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
+                alt fcx.mk_subty(ty, for_ty) {
+                  result::err(_) { cont; }
+                  result::ok(()) { }
+                }
 
-                    // check that desired iface type unifies
-                    #debug("(checking vtable) @2 relating iface ty %s to \
-                            of_ty %s",
-                            fcx.infcx.ty_to_str(iface_ty),
-                            fcx.infcx.ty_to_str(of_ty));
-                    let of_ty = ty::subst(tcx, substs, of_ty);
-                    relate_iface_tys(fcx, sp, iface_ty, of_ty);
+                // check that desired iface type unifies
+                #debug("(checking vtable) @2 relating iface ty %s to \
+                        of_ty %s",
+                       fcx.infcx.ty_to_str(iface_ty),
+                       fcx.infcx.ty_to_str(of_ty));
+                let of_ty = ty::subst(tcx, substs, of_ty);
+                relate_iface_tys(fcx, sp, iface_ty, of_ty);
 
-                    // recursively process the bounds
-                    let iface_tps = iface_substs.tps;
-                    let substs_f = fixup_substs(fcx, sp, iface_id, substs);
-                    connect_iface_tps(fcx, sp, substs_f.tps,
-                                      iface_tps, im.did);
-                    let subres = lookup_vtables(fcx, isc, sp,
-                                                im_bs, substs_f, false);
-                    vec::push(found,
-                              vtable_static(im.did, substs_f.tps, subres));
-                }
+                // recursively process the bounds
+                let iface_tps = iface_substs.tps;
+                let substs_f = fixup_substs(fcx, sp, iface_id, substs);
+                connect_iface_tps(fcx, sp, substs_f.tps,
+                                  iface_tps, im.did);
+                let subres = lookup_vtables(fcx, isc, sp,
+                                            im_bs, substs_f, false);
+                vec::push(found,
+                          vtable_static(im.did, substs_f.tps, subres));
+            }
 
-                alt found.len() {
-                  0u { /* fallthrough */ }
-                  1u { ret found[0]; }
-                  _ {
-                    fcx.ccx.tcx.sess.span_err(
-                        sp, "multiple applicable methods in scope");
-                    ret found[0];
-                  }
-                }
+            alt found.len() {
+              0u { /* fallthrough */ }
+              1u { ret found[0]; }
+              _ {
+                fcx.ccx.tcx.sess.span_err(
+                    sp, "multiple applicable methods in scope");
+                ret found[0];
+              }
             }
-          }
         }
-
-        tcx.sess.span_fatal(
-            sp, "failed to find an implementation of interface " +
-            ty_to_str(tcx, iface_ty) + " for " +
-            ty_to_str(tcx, ty));
+      }
     }
 
+    tcx.sess.span_fatal(
+        sp, "failed to find an implementation of interface " +
+        ty_to_str(tcx, iface_ty) + " for " +
+        ty_to_str(tcx, ty));
+}
+
 fn fixup_ty(fcx: @fn_ctxt, sp: span, ty: ty::t) -> ty::t {
     let tcx = fcx.ccx.tcx;
     alt infer::resolve_deep(fcx.infcx, ty, force_all) {