Skip to content

New snapshots + loop => continue #9665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libextra/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl<'self> FromBase64 for &'self str {
'0'..'9' => buf |= val + 0x04,
'+'|'-' => buf |= 0x3E,
'/'|'_' => buf |= 0x3F,
'\r'|'\n' => loop,
'\r'|'\n' => continue,
'=' => break,
_ => return Err(format!("Invalid character '{}' at position {}",
self.char_at(idx), idx))
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/fileinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl io::Reader for FileInput {
let b = r.read_byte();

if b < 0 {
loop;
continue;
}

if b == '\n' as int {
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl Pattern {
let cs = parse_char_specifiers(chars.slice(i + 2, i + 3 + j));
tokens.push(AnyExcept(cs));
i += j + 4;
loop;
continue;
}
}
}
Expand All @@ -222,7 +222,7 @@ impl Pattern {
let cs = parse_char_specifiers(chars.slice(i + 1, i + 2 + j));
tokens.push(AnyWithin(cs));
i += j + 3;
loop;
continue;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<'self> FromHex for &'self str {
'0'..'9' => buf |= byte - ('0' as u8),
' '|'\r'|'\n'|'\t' => {
buf >>= 4;
loop
continue
}
_ => return Err(format!("Invalid character '{}' at position {}",
self.char_at(idx), idx))
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/num/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ impl Integer for BigUint {
}
if d0.is_zero() {
n = 2;
loop;
continue;
}
n = 1;
// FIXME(#6102): Assignment operator for BigInt causes ICE
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/priority_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<T:Ord> PriorityQueue<T> {
let x = replace(&mut self.data[parent], init());
move_val_init(&mut self.data[pos], x);
pos = parent;
loop
continue
}
break
}
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/terminfo/parser/compiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
for (i, v) in string_offsets.iter().enumerate() {
let offset = *v;
if offset == 0xFFFF { // non-entry
loop;
continue;
}

let name = if snames[i] == "_" {
Expand All @@ -289,7 +289,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
// undocumented: FFFE indicates cap@, which means the capability is not present
// unsure if the handling for this is correct
string_map.insert(name.to_owned(), ~[]);
loop;
continue;
}


Expand Down
8 changes: 4 additions & 4 deletions src/libextra/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@ pub fn query_to_str(query: &Query) -> ~str {
pub fn get_scheme(rawurl: &str) -> Result<(~str, ~str), ~str> {
for (i,c) in rawurl.iter().enumerate() {
match c {
'A' .. 'Z' | 'a' .. 'z' => loop,
'A' .. 'Z' | 'a' .. 'z' => continue,
'0' .. '9' | '+' | '-' | '.' => {
if i == 0 {
return Err(~"url: Scheme must begin with a letter.");
}
loop;
continue;
}
':' => {
if i == 0 {
Expand Down Expand Up @@ -420,7 +420,7 @@ fn get_authority(rawurl: &str) ->
let mut end = len;

for (i,c) in rawurl.iter().enumerate() {
if i < 2 { loop; } // ignore the leading //
if i < 2 { continue; } // ignore the leading //

// deal with input class first
match c {
Expand Down Expand Up @@ -558,7 +558,7 @@ fn get_path(rawurl: &str, authority: bool) ->
'A' .. 'Z' | 'a' .. 'z' | '0' .. '9' | '&' |'\'' | '(' | ')' | '.'
| '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
| '_' | '-' => {
loop;
continue;
}
'?' | '#' => {
end = i;
Expand Down
2 changes: 1 addition & 1 deletion src/librust/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub fn main() {
os::set_exit_status(exit_code);
return;
}
_ => loop
_ => {}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ pub fn link_args(sess: Session,
for cratepath in r.iter() {
if cratepath.filetype() == Some(".rlib") {
args.push(cratepath.to_str());
loop;
continue;
}
let dir = cratepath.dirname();
if dir != ~"" { args.push(~"-L" + dir); }
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/borrowck/check_loans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ impl<'self> CheckLoanCtxt<'self> {
debug2!("illegal_if={:?}", illegal_if);

for restr in loan1.restrictions.iter() {
if !restr.set.intersects(illegal_if) { loop; }
if restr.loan_path != loan2.loan_path { loop; }
if !restr.set.intersects(illegal_if) { continue; }
if restr.loan_path != loan2.loan_path { continue; }

match (new_loan.mutbl, old_loan.mutbl) {
(MutableMutability, MutableMutability) => {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ pub fn each_lint(sess: session::Session,
ast::MetaList(_, ref metas) => metas,
_ => {
sess.span_err(meta.span, "malformed lint attribute");
loop;
continue;
}
};
for meta in metas.iter() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl PrivacyVisitor {
fn check_field(&mut self, span: Span, id: ast::DefId, ident: ast::Ident) {
let fields = ty::lookup_struct_fields(self.tcx, id);
for field in fields.iter() {
if field.name != ident.name { loop; }
if field.name != ident.name { continue; }
if field.vis == private {
self.tcx.sess.span_err(span, format!("field `{}` is private",
token::ident_to_str(&ident)));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl ReachableContext {
while self.worklist.len() > 0 {
let search_item = self.worklist.pop();
if scanned.contains(&search_item) {
loop
continue
}
scanned.insert(search_item);
self.reachable_symbols.insert(search_item);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3334,7 +3334,7 @@ impl Resolver {
if importresolution.privacy != Public {
debug2!("(computing exports) not reexporting private `{}`",
interner_get(*name));
loop;
continue;
}
let xs = [TypeNS, ValueNS];
for ns in xs.iter() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/cabi_x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ fn llreg_ty(cls: &[RegClass]) -> Type {
let vec_ty = Type::vector(&Type::f32(), (vec_len * 2u) as u64);
tys.push(vec_ty);
i += vec_len;
loop;
continue;
}
SSEFs => {
tys.push(Type::f32());
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ fn conv_builtin_bounds(tcx: ty::ctxt, ast_bounds: &Option<OptVec<ast::TyParamBou
ast::DefTrait(trait_did) => {
if ty::try_add_builtin_trait(tcx, trait_did,
&mut builtin_bounds) {
loop; // success
continue; // success
}
}
_ => { }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
if !etc {
for (i, field) in class_fields.iter().enumerate() {
if found_fields.contains(&i) {
loop;
continue;
}
tcx.sess.span_err(span,
format!("pattern does not mention field `{}`",
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/check/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ impl<'self> LookupContext<'self> {

if skip {
// There are more than one of these and we need only one
loop;
continue;
} else {
merged.push(candidate_a.clone());
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/typeck/check/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ fn search_for_vtable(vcx: &VtableContext,

// First, ensure we haven't processed this impl yet.
if impls_seen.contains(&im.did) {
loop;
continue;
}
impls_seen.insert(im.did);

Expand All @@ -349,7 +349,7 @@ fn search_for_vtable(vcx: &VtableContext,
// get all the ty vars sorted out.
let r = ty::impl_trait_ref(tcx, im.did);
let of_trait_ref = r.expect("trait_ref missing on trait impl");
if of_trait_ref.def_id != trait_ref.def_id { loop; }
if of_trait_ref.def_id != trait_ref.def_id { continue; }

// At this point, we know that of_trait_ref is the same trait
// as trait_ref, but possibly applied to different substs.
Expand Down Expand Up @@ -377,7 +377,7 @@ fn search_for_vtable(vcx: &VtableContext,
location_info.span),
ty,
for_ty) {
result::Err(_) => loop,
result::Err(_) => continue,
result::Ok(()) => ()
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ impl CoherenceChecker {
let r = ty::trait_methods(tcx, trait_did);
for method in r.iter() {
debug2!("checking for {}", method.ident.repr(tcx));
if provided_names.contains(&method.ident.name) { loop; }
if provided_names.contains(&method.ident.name) { continue; }

tcx.sess.span_err(trait_ref_span,
format!("missing method `{}`",
Expand Down Expand Up @@ -730,7 +730,7 @@ impl CoherenceChecker {
for impl_info in impls.iter() {
if impl_info.methods.len() < 1 {
// We'll error out later. For now, just don't ICE.
loop;
continue;
}
let method_def_id = impl_info.methods[0].def_id;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/infer/region_inference/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,15 +919,15 @@ impl RegionVarBindings {
ConstrainVarSubVar(*) |
ConstrainRegSubVar(*) |
ConstrainVarSubReg(*) => {
loop;
continue;
}
ConstrainRegSubReg(sub, sup) => {
(sub, sup)
}
};

if self.is_subregion_of(sub, sup) {
loop;
continue;
}

debug2!("ConcreteFailure: !(sub <= sup): sub={:?}, sup={:?}",
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/infer/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ impl Combine for Sub {
// or new variables:
match *tainted_region {
ty::re_infer(ty::ReVar(ref vid)) => {
if new_vars.iter().any(|x| x == vid) { loop; }
if new_vars.iter().any(|x| x == vid) { continue; }
}
_ => {
if *tainted_region == skol { loop; }
if *tainted_region == skol { continue; }
}
};

Expand Down
12 changes: 6 additions & 6 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn clean_srcpath(src: &str, f: &fn(&str)) {
let p = Path(src);
for c in p.components.iter() {
if "." == *c {
loop
continue
}
if ".." == *c {
f("up");
Expand Down Expand Up @@ -928,7 +928,7 @@ fn item_module(w: &mut io::Writer, cx: &Context,
}

_ => {
if myitem.name.is_none() { loop }
if myitem.name.is_none() { continue }
write!(w, "
<tr>
<td><a class='{class}' href='{href}'
Expand Down Expand Up @@ -1276,15 +1276,15 @@ fn render_impl(w: &mut io::Writer, i: &clean::Impl, dox: &Option<~str>) {
match meth.doc_value() {
Some(s) => {
write!(w, "<div class='docblock'>{}</div>", Markdown(s));
loop
continue
}
None => {}
}

// No documentation? Attempt to slurp in the trait's documentation
let trait_id = match trait_id {
None => loop,
Some(id) if is_local(id) => loop,
None => continue,
Some(id) if is_local(id) => continue,
Some(id) => id.node,
};
do local_data::get(cache_key) |cache| {
Expand Down Expand Up @@ -1369,7 +1369,7 @@ fn build_sidebar(m: &clean::Module) -> HashMap<~str, ~[~str]> {
for item in m.items.iter() {
let short = shortty(item);
let myname = match item.name {
None => loop,
None => continue,
Some(ref s) => s.to_owned(),
};
let v = map.find_or_insert_with(short.to_owned(), |_| ~[]);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
Some(i) => PASSES[i].n1(),
None => {
error2!("unknown pass {}, skipping", *pass);
loop
continue
},
};
pm.add_plugin(plugin);
Expand Down
2 changes: 1 addition & 1 deletion src/librusti/rusti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ pub fn main_args(args: &[~str]) -> int {
if istty {
println("()");
}
loop;
continue;
}
run_line(&mut repl, input, out, line, istty);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustpkg/path_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Opti
// Find a filename that matches the pattern: (lib_prefix)-hash-(version)(lib_suffix)
// and remember what the hash was
let mut f_name = match p_path.filestem() {
Some(s) => s, None => loop
Some(s) => s, None => continue
};
// Already checked the filetype above

Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ pub fn try_getting_local_version(local_path: &Path) -> Option<Version> {
let local_path = rp.push_rel(local_path);
let git_dir = local_path.push(".git");
if !os::path_is_dir(&git_dir) {
loop;
continue;
}
let outp = run::process_output("git",
[format!("--git-dir={}", git_dir.to_str()), ~"tag", ~"-l"]);

debug2!("git --git-dir={} tag -l ~~~> {:?}", git_dir.to_str(), outp.status);

if outp.status != 0 {
loop;
continue;
}

let mut output = None;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ impl<T:Reader> ReaderUtil for T {
unsafe {
chars.push(transmute(b0 as u32));
}
loop;
continue;
}
// can't satisfy this char with the existing data
if end > bytes_len {
Expand Down
Loading