Convert 'again' to 'loop'. Remove 'again' keyword

This commit is contained in:
Brian Anderson
2012-09-07 15:32:04 -07:00
parent 073df63c72
commit 2810ea9a68
35 changed files with 56 additions and 56 deletions

View File

@@ -687,7 +687,7 @@ fn link_binary(sess: session,
for cstore::get_used_crate_files(cstore).each |cratepath| {
if cratepath.filetype() == Some(~"rlib") {
vec::push(cc_args, cratepath.to_str());
again;
loop;
}
let dir = cratepath.dirname();
if dir != ~"" { vec::push(cc_args, ~"-L" + dir); }

View File

@@ -772,7 +772,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::Writer, item: @item,
// maybe we should only ever handle the real type signatures.
for vec::each(ms) |m| {
let ty_m = ast_util::trait_method_to_ty_method(m);
if ty_m.self_ty.node != ast::sty_static { again; }
if ty_m.self_ty.node != ast::sty_static { loop; }
vec::push(*index, {val: ty_m.id, pos: ebml_w.writer.tell()});

View File

@@ -266,7 +266,7 @@ impl check_loan_ctxt {
for self.walk_loans(par_scope_id) |old_loan| {
for (*new_loanss).each |new_loans| {
for (*new_loans).each |new_loan| {
if old_loan.lp != new_loan.lp { again; }
if old_loan.lp != new_loan.lp { loop; }
match (old_loan.mutbl, new_loan.mutbl) {
(m_const, _) | (_, m_const) |
(m_mutbl, m_mutbl) | (m_imm, m_imm) => {

View File

@@ -199,7 +199,7 @@ fn check_fn(fk: visit::fn_kind, decl: fn_decl, body: blk, sp: span,
let id = ast_util::def_id_of_def(fv.def).node;
// skip over free variables that appear in the cap clause
if captured_vars.contains(id) { again; }
if captured_vars.contains(id) { loop; }
// if this is the last use of the variable, then it will be
// a move and not a copy

View File

@@ -193,7 +193,7 @@ struct LanguageItemCollector {
}
dl_def(_) | dl_impl(_) | dl_field => {
// Skip this.
again;
loop;
}
}

View File

@@ -36,7 +36,7 @@ fn check_crate(tcx: ty::ctxt, method_map: &method_map, crate: @ast::crate) {
let check_field = |span, id, ident| {
let fields = ty::lookup_class_fields(tcx, id);
for fields.each |field| {
if field.ident != ident { again; }
if field.ident != ident { loop; }
if field.vis == private {
tcx.sess.span_err(span, fmt!("field `%s` is private",
*tcx.sess.parse_sess.interner

View File

@@ -2156,7 +2156,7 @@ struct Resolver {
if !self.name_is_exported(containing_module, atom) {
debug!("(resolving glob import) name `%s` is unexported",
self.session.str_of(atom));
again;
loop;
}
debug!("(resolving glob import) writing module resolution \
@@ -2220,7 +2220,7 @@ struct Resolver {
if !self.name_is_exported(containing_module, atom) {
debug!("(resolving glob import) name `%s` is unexported",
self.session.str_of(atom));
again;
loop;
}
let mut dest_import_resolution;

View File

@@ -2537,7 +2537,7 @@ fn crate_ctxt_to_encode_parms(cx: @crate_ctxt)
let mut reexports = ~[];
for cx.exp_map.each |exp_id, defs| {
for defs.each |def| {
if !def.reexp { again; }
if !def.reexp { loop; }
let path = match cx.tcx.items.get(exp_id) {
ast_map::node_export(_, path) => {
ast_map::path_to_str(*path, cx.sess.parse_sess.interner)

View File

@@ -305,7 +305,7 @@ fn llreg_ty(cls: ~[x86_64_reg_class]) -> TypeRef {
vec_len as c_uint);
vec::push(tys, vec_ty);
i += vec_len;
again;
loop;
}
sse_fs_class => {
vec::push(tys, T_f32());

View File

@@ -381,7 +381,7 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
if !etc {
for class_fields.eachi |i, field| {
if found_fields.contains_key(i) {
again;
loop;
}
tcx.sess.span_err(pat.span,
fmt!("pattern does not mention field `%s`",

View File

@@ -298,7 +298,7 @@ struct lookup {
let (trait_id, bound_substs) = match bound {
ty::bound_copy | ty::bound_send | ty::bound_const |
ty::bound_owned => {
again; /* ok */
loop; /* ok */
}
ty::bound_trait(bound_t) => {
match ty::get(bound_t).struct {
@@ -352,7 +352,7 @@ struct lookup {
let ms = *ty::trait_methods(self.tcx(), did);
for ms.eachi |i, m| {
if m.ident != self.m_name { again; }
if m.ident != self.m_name { loop; }
let m_fty = ty::mk_fn(self.tcx(), m.fty);
@@ -391,7 +391,7 @@ struct lookup {
let ms = *ty::trait_methods(self.tcx(), did);
for ms.each |m| {
if m.ident != self.m_name { again; }
if m.ident != self.m_name { loop; }
if m.vis == ast::private && !self.include_private {
self.tcx().sess.span_fatal(

View File

@@ -183,7 +183,7 @@ fn lookup_vtable(fcx: @fn_ctxt,
// First, ensure we haven't processed this impl yet.
if impls_seen.contains_key(im.did) {
again;
loop;
}
impls_seen.insert(im.did, ());
@@ -208,7 +208,7 @@ fn lookup_vtable(fcx: @fn_ctxt,
match ty::get(of_ty).struct {
ty::ty_trait(id, _, _) => {
// Not the trait we're looking for
if id != trait_id { again; }
if id != trait_id { loop; }
}
_ => { /* ok */ }
}
@@ -233,7 +233,7 @@ fn lookup_vtable(fcx: @fn_ctxt,
let im_bs = ty::lookup_item_type(tcx,
im.did).bounds;
match fcx.mk_subty(false, expr.span, ty, for_ty) {
result::Err(_) => again,
result::Err(_) => loop,
result::Ok(()) => ()
}

View File

@@ -659,7 +659,7 @@ struct CoherenceChecker {
}
Some(_) => {
// Skip this one.
again;
loop;
}
}
@@ -741,7 +741,7 @@ struct CoherenceChecker {
}
dl_def(_) | dl_impl(_) | dl_field => {
// Skip this.
again;
loop;
}
}