Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4f67dcb2
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f67dcb2
编写于
10月 01, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate users of 'loop' to 'continue'
Closes #9467
上级
4af849bc
变更
49
隐藏空白更改
内联
并排
Showing
49 changed file
with
78 addition
and
78 deletion
+78
-78
src/libextra/base64.rs
src/libextra/base64.rs
+1
-1
src/libextra/fileinput.rs
src/libextra/fileinput.rs
+1
-1
src/libextra/glob.rs
src/libextra/glob.rs
+2
-2
src/libextra/hex.rs
src/libextra/hex.rs
+1
-1
src/libextra/num/bigint.rs
src/libextra/num/bigint.rs
+1
-1
src/libextra/priority_queue.rs
src/libextra/priority_queue.rs
+1
-1
src/libextra/terminfo/parser/compiled.rs
src/libextra/terminfo/parser/compiled.rs
+2
-2
src/libextra/url.rs
src/libextra/url.rs
+4
-4
src/librust/rust.rs
src/librust/rust.rs
+1
-1
src/librustc/back/link.rs
src/librustc/back/link.rs
+1
-1
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/check_loans.rs
+2
-2
src/librustc/middle/lint.rs
src/librustc/middle/lint.rs
+1
-1
src/librustc/middle/privacy.rs
src/librustc/middle/privacy.rs
+1
-1
src/librustc/middle/reachable.rs
src/librustc/middle/reachable.rs
+1
-1
src/librustc/middle/resolve.rs
src/librustc/middle/resolve.rs
+1
-1
src/librustc/middle/trans/cabi_x86_64.rs
src/librustc/middle/trans/cabi_x86_64.rs
+1
-1
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/astconv.rs
+1
-1
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/_match.rs
+1
-1
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/check/method.rs
+1
-1
src/librustc/middle/typeck/check/vtable.rs
src/librustc/middle/typeck/check/vtable.rs
+3
-3
src/librustc/middle/typeck/coherence.rs
src/librustc/middle/typeck/coherence.rs
+2
-2
src/librustc/middle/typeck/infer/region_inference/mod.rs
src/librustc/middle/typeck/infer/region_inference/mod.rs
+2
-2
src/librustc/middle/typeck/infer/sub.rs
src/librustc/middle/typeck/infer/sub.rs
+2
-2
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+6
-6
src/librustdoc/rustdoc.rs
src/librustdoc/rustdoc.rs
+1
-1
src/librusti/rusti.rs
src/librusti/rusti.rs
+1
-1
src/librustpkg/path_util.rs
src/librustpkg/path_util.rs
+1
-1
src/librustpkg/version.rs
src/librustpkg/version.rs
+2
-2
src/libstd/io.rs
src/libstd/io.rs
+1
-1
src/libstd/iter.rs
src/libstd/iter.rs
+4
-4
src/libstd/num/strconv.rs
src/libstd/num/strconv.rs
+1
-1
src/libstd/path.rs
src/libstd/path.rs
+3
-3
src/libstd/rand/mod.rs
src/libstd/rand/mod.rs
+1
-1
src/libstd/rt/logging.rs
src/libstd/rt/logging.rs
+2
-2
src/libsyntax/ast_util.rs
src/libsyntax/ast_util.rs
+2
-2
src/libsyntax/attr.rs
src/libsyntax/attr.rs
+1
-1
src/libsyntax/ext/format.rs
src/libsyntax/ext/format.rs
+3
-3
src/libsyntax/parse/lexer.rs
src/libsyntax/parse/lexer.rs
+1
-1
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+1
-1
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+1
-1
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
+1
-1
src/test/bench/shootout-reverse-complement.rs
src/test/bench/shootout-reverse-complement.rs
+1
-1
src/test/compile-fail/borrowck-lend-flow-loop.rs
src/test/compile-fail/borrowck-lend-flow-loop.rs
+1
-1
src/test/run-pass/break.rs
src/test/run-pass/break.rs
+3
-3
src/test/run-pass/foreach-external-iterators-loop.rs
src/test/run-pass/foreach-external-iterators-loop.rs
+1
-1
src/test/run-pass/issue-2216.rs
src/test/run-pass/issue-2216.rs
+1
-1
src/test/run-pass/loop-break-cont.rs
src/test/run-pass/loop-break-cont.rs
+2
-2
src/test/run-pass/terminate-in-initializer.rs
src/test/run-pass/terminate-in-initializer.rs
+1
-1
src/test/run-pass/weird-exprs.rs
src/test/run-pass/weird-exprs.rs
+1
-1
未找到文件。
src/libextra/base64.rs
浏览文件 @
4f67dcb2
...
...
@@ -200,7 +200,7 @@ fn from_base64(&self) -> Result<~[u8], ~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
))
...
...
src/libextra/fileinput.rs
浏览文件 @
4f67dcb2
...
...
@@ -303,7 +303,7 @@ fn read_byte(&self) -> int {
let
b
=
r
.read_byte
();
if
b
<
0
{
loop
;
continue
;
}
if
b
==
'\n'
as
int
{
...
...
src/libextra/glob.rs
浏览文件 @
4f67dcb2
...
...
@@ -211,7 +211,7 @@ pub fn new(pattern: &str) -> Pattern {
let
cs
=
parse_char_specifiers
(
chars
.slice
(
i
+
2
,
i
+
3
+
j
));
tokens
.push
(
AnyExcept
(
cs
));
i
+=
j
+
4
;
loop
;
continue
;
}
}
}
...
...
@@ -222,7 +222,7 @@ pub fn new(pattern: &str) -> Pattern {
let
cs
=
parse_char_specifiers
(
chars
.slice
(
i
+
1
,
i
+
2
+
j
));
tokens
.push
(
AnyWithin
(
cs
));
i
+=
j
+
3
;
loop
;
continue
;
}
}
}
...
...
src/libextra/hex.rs
浏览文件 @
4f67dcb2
...
...
@@ -100,7 +100,7 @@ fn from_hex(&self) -> Result<~[u8], ~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
))
...
...
src/libextra/num/bigint.rs
浏览文件 @
4f67dcb2
...
...
@@ -413,7 +413,7 @@ fn div_mod_floor_inner(a: BigUint, b: BigUint) -> (BigUint, BigUint) {
}
if
d0
.is_zero
()
{
n
=
2
;
loop
;
continue
;
}
n
=
1
;
// FIXME(#6102): Assignment operator for BigInt causes ICE
...
...
src/libextra/priority_queue.rs
浏览文件 @
4f67dcb2
...
...
@@ -140,7 +140,7 @@ fn siftup(&mut self, start: uint, mut pos: uint) {
let
x
=
replace
(
&
mut
self
.data
[
parent
],
init
());
move_val_init
(
&
mut
self
.data
[
pos
],
x
);
pos
=
parent
;
loop
continue
}
break
}
...
...
src/libextra/terminfo/parser/compiled.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
]
==
"_"
{
...
...
@@ -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
;
}
...
...
src/libextra/url.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
{
...
...
@@ -420,7 +420,7 @@ enum State {
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
{
...
...
@@ -558,7 +558,7 @@ fn get_path(rawurl: &str, authority: bool) ->
'A'
..
'Z'
|
'a'
..
'z'
|
'0'
..
'9'
|
'&'
|
'\''
|
'('
|
')'
|
'.'
|
'@'
|
':'
|
'%'
|
'/'
|
'+'
|
'!'
|
'*'
|
','
|
';'
|
'='
|
'_'
|
'-'
=>
{
loop
;
continue
;
}
'?'
|
'#'
=>
{
end
=
i
;
...
...
src/librust/rust.rs
浏览文件 @
4f67dcb2
...
...
@@ -247,7 +247,7 @@ pub fn main() {
os
::
set_exit_status
(
exit_code
);
return
;
}
_
=>
loop
_
=>
{}
}
}
}
...
...
src/librustc/back/link.rs
浏览文件 @
4f67dcb2
...
...
@@ -1004,7 +1004,7 @@ fn unlib(config: @session::config, stem: ~str) -> ~str {
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
);
}
...
...
src/librustc/middle/borrowck/check_loans.rs
浏览文件 @
4f67dcb2
...
...
@@ -263,8 +263,8 @@ pub fn report_error_if_loan_conflicts_with_restriction(&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
)
=>
{
...
...
src/librustc/middle/lint.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
()
{
...
...
src/librustc/middle/privacy.rs
浏览文件 @
4f67dcb2
...
...
@@ -225,7 +225,7 @@ fn local_item_is_private(&mut self, span: Span, item_id: NodeId) -> bool {
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
)));
...
...
src/librustc/middle/reachable.rs
浏览文件 @
4f67dcb2
...
...
@@ -359,7 +359,7 @@ fn propagate(&self) {
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
);
...
...
src/librustc/middle/resolve.rs
浏览文件 @
4f67dcb2
...
...
@@ -3334,7 +3334,7 @@ pub fn add_exports_for_module(&mut self,
if
importresolution
.privacy
!=
Public
{
debug2!
(
"(computing exports) not reexporting private `{}`"
,
interner_get
(
*
name
));
loop
;
continue
;
}
let
xs
=
[
TypeNS
,
ValueNS
];
for
ns
in
xs
.iter
()
{
...
...
src/librustc/middle/trans/cabi_x86_64.rs
浏览文件 @
4f67dcb2
...
...
@@ -317,7 +317,7 @@ fn llvec_len(cls: &[RegClass]) -> uint {
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
());
...
...
src/librustc/middle/typeck/astconv.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
}
}
_
=>
{
}
...
...
src/librustc/middle/typeck/check/_match.rs
浏览文件 @
4f67dcb2
...
...
@@ -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 `{}`"
,
...
...
src/librustc/middle/typeck/check/method.rs
浏览文件 @
4f67dcb2
...
...
@@ -922,7 +922,7 @@ fn merge_candidates(&self, candidates: &[Candidate]) -> ~[Candidate] {
if
skip
{
// There are more than one of these and we need only one
loop
;
continue
;
}
else
{
merged
.push
(
candidate_a
.clone
());
}
...
...
src/librustc/middle/typeck/check/vtable.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
);
...
...
@@ -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.
...
...
@@ -377,7 +377,7 @@ fn search_for_vtable(vcx: &VtableContext,
location_info
.span
),
ty
,
for_ty
)
{
result
::
Err
(
_
)
=>
loop
,
result
::
Err
(
_
)
=>
continue
,
result
::
Ok
(())
=>
()
}
...
...
src/librustc/middle/typeck/coherence.rs
浏览文件 @
4f67dcb2
...
...
@@ -558,7 +558,7 @@ pub fn check_trait_methods_are_implemented(
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 `{}`"
,
...
...
@@ -730,7 +730,7 @@ pub fn populate_destructor_table(&self) {
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
;
...
...
src/librustc/middle/typeck/infer/region_inference/mod.rs
浏览文件 @
4f67dcb2
...
...
@@ -919,7 +919,7 @@ fn collect_concrete_region_errors(
ConstrainVarSubVar
(
*
)
|
ConstrainRegSubVar
(
*
)
|
ConstrainVarSubReg
(
*
)
=>
{
loop
;
continue
;
}
ConstrainRegSubReg
(
sub
,
sup
)
=>
{
(
sub
,
sup
)
...
...
@@ -927,7 +927,7 @@ fn collect_concrete_region_errors(
};
if
self
.is_subregion_of
(
sub
,
sup
)
{
loop
;
continue
;
}
debug2!
(
"ConcreteFailure: !(sub <= sup): sub={:?}, sup={:?}"
,
...
...
src/librustc/middle/typeck/infer/sub.rs
浏览文件 @
4f67dcb2
...
...
@@ -199,10 +199,10 @@ fn fn_sigs(&self, a: &ty::FnSig, b: &ty::FnSig) -> cres<ty::FnSig> {
// 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
;
}
}
};
...
...
src/librustdoc/html/render.rs
浏览文件 @
4f67dcb2
...
...
@@ -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"
);
...
...
@@ -928,7 +928,7 @@ fn fmt(s: &Initializer<'self>, f: &mut fmt::Formatter) {
}
_
=>
{
if
myitem
.name
.is_none
()
{
loop
}
if
myitem
.name
.is_none
()
{
continue
}
write!
(
w
,
"
<tr>
<td><a class='{class}' href='{href}'
...
...
@@ -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
|
{
...
...
@@ -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
(),
|
_
|
~
[]);
...
...
src/librustdoc/rustdoc.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
);
...
...
src/librusti/rusti.rs
浏览文件 @
4f67dcb2
...
...
@@ -569,7 +569,7 @@ pub fn main_args(args: &[~str]) -> int {
if
istty
{
println
(
"()"
);
}
loop
;
continue
;
}
run_line
(
&
mut
repl
,
input
,
out
,
line
,
istty
);
}
...
...
src/librustpkg/path_util.rs
浏览文件 @
4f67dcb2
...
...
@@ -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
...
...
src/librustpkg/version.rs
浏览文件 @
4f67dcb2
...
...
@@ -101,7 +101,7 @@ 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"
]);
...
...
@@ -109,7 +109,7 @@ pub fn try_getting_local_version(local_path: &Path) -> Option<Version> {
debug2!
(
"git --git-dir={} tag -l ~~~> {:?}"
,
git_dir
.to_str
(),
outp
.status
);
if
outp
.status
!=
0
{
loop
;
continue
;
}
let
mut
output
=
None
;
...
...
src/libstd/io.rs
浏览文件 @
4f67dcb2
...
...
@@ -665,7 +665,7 @@ fn chars_from_utf8<T:Reader>(bytes: &~[u8], chars: &mut ~[char])
unsafe
{
chars
.push
(
transmute
(
b0
as
u32
));
}
loop
;
continue
;
}
// can't satisfy this char with the existing data
if
end
>
bytes_len
{
...
...
src/libstd/iter.rs
浏览文件 @
4f67dcb2
...
...
@@ -1150,7 +1150,7 @@ fn next(&mut self) -> Option<A> {
if
(
self
.predicate
)(
&
x
)
{
return
Some
(
x
);
}
else
{
loop
continue
}
}
None
...
...
@@ -1173,7 +1173,7 @@ fn next_back(&mut self) -> Option<A> {
if
(
self
.predicate
)(
&
x
)
{
return
Some
(
x
);
}
else
{
loop
continue
}
}
}
...
...
@@ -1342,7 +1342,7 @@ fn next(&mut self) -> Option<A> {
Some
(
x
)
=>
{
if
(
self
.predicate
)(
&
x
)
{
next
=
self
.iter
.next
();
loop
continue
}
else
{
self
.flag
=
true
;
return
Some
(
x
)
...
...
@@ -1415,7 +1415,7 @@ fn next(&mut self) -> Option<A> {
match
next
{
Some
(
_
)
=>
{
next
=
self
.iter
.next
();
loop
continue
}
None
=>
{
self
.n
=
0
;
...
...
src/libstd/num/strconv.rs
浏览文件 @
4f67dcb2
...
...
@@ -355,7 +355,7 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+
}
// Skip the '.'
if
buf
[
i
]
==
'.'
as
u8
{
i
-=
1
;
loop
;
}
if
buf
[
i
]
==
'.'
as
u8
{
i
-=
1
;
continue
;
}
// Either increment the digit,
// or set to 0 if max and carry the 1.
...
...
src/libstd/path.rs
浏览文件 @
4f67dcb2
...
...
@@ -992,11 +992,11 @@ fn components<'a>(&'a self) -> &'a [~str] { self.components.as_slice() }
pub
fn
normalize
(
components
:
&
[
~
str
])
->
~
[
~
str
]
{
let
mut
cs
=
~
[];
for
c
in
components
.iter
()
{
if
*
c
==
~
"."
&&
components
.len
()
>
1
{
loop
;
}
if
*
c
==
~
""
{
loop
;
}
if
*
c
==
~
"."
&&
components
.len
()
>
1
{
continue
;
}
if
*
c
==
~
""
{
continue
;
}
if
*
c
==
~
".."
&&
cs
.len
()
!=
0
{
cs
.pop
();
loop
;
continue
;
}
cs
.push
((
*
c
)
.clone
());
}
...
...
src/libstd/rand/mod.rs
浏览文件 @
4f67dcb2
...
...
@@ -543,7 +543,7 @@ fn sample<A, T: Iterator<A>>(&mut self, iter: T, n: uint) -> ~[A] {
for
(
i
,
elem
)
in
iter
.enumerate
()
{
if
i
<
n
{
reservoir
.push
(
elem
);
loop
continue
}
let
k
=
self
.gen_integer_range
(
0
,
i
+
1
);
...
...
src/libstd/rt/logging.rs
浏览文件 @
4f67dcb2
...
...
@@ -92,14 +92,14 @@ fn parse_logging_spec(spec: ~str) -> ~[LogDirective]{
_
=>
{
dumb_println
(
format!
(
"warning: invalid logging spec
\
'{}', ignoring it"
,
parts
[
1
]));
loop
;
continue
;
}
}
},
_
=>
{
dumb_println
(
format!
(
"warning: invalid logging spec '{}',
\
ignoring it"
,
s
));
loop
;
continue
;
}
}
let
dir
=
LogDirective
{
name
:
name
,
level
:
log_level
};
...
...
src/libsyntax/ast_util.rs
浏览文件 @
4f67dcb2
...
...
@@ -1057,12 +1057,12 @@ fn refold_test_sc(mut sc: SyntaxContext, table : &SCTable) -> ~[TestSC] {
Mark
(
mrk
,
tail
)
=>
{
result
.push
(
M
(
mrk
));
sc
=
tail
;
loop
;
continue
;
},
Rename
(
id
,
name
,
tail
)
=>
{
result
.push
(
R
(
id
,
name
));
sc
=
tail
;
loop
;
continue
;
}
IllegalCtxt
=>
fail2!
(
"expected resolvable context, got IllegalCtxt"
)
}
...
...
src/libsyntax/attr.rs
浏览文件 @
4f67dcb2
...
...
@@ -340,7 +340,7 @@ pub fn find_stability<AM: AttrMetaMethods, It: Iterator<AM>>(mut metas: It) -> O
"stable"
=>
Stable
,
"frozen"
=>
Frozen
,
"locked"
=>
Locked
,
_
=>
loop
// not a stability level
_
=>
continue
// not a stability level
};
return
Some
(
Stability
{
...
...
src/libsyntax/ext/format.rs
浏览文件 @
4f67dcb2
...
...
@@ -108,7 +108,7 @@ fn parse_args(&mut self, sp: Span,
named `{}`"
,
name
));
self
.ecx.parse_sess.span_diagnostic
.span_note
(
prev
.span
,
"previously here"
);
loop
continue
}
}
self
.names
.insert
(
name
,
e
);
...
...
@@ -592,7 +592,7 @@ fn to_expr(&self, extra: @ast::Expr) -> @ast::Expr {
// of each variable because we don't want to move out of the arguments
// passed to this function.
for
(
i
,
&
e
)
in
self
.args
.iter
()
.enumerate
()
{
if
self
.arg_types
[
i
]
.is_none
()
{
loop
}
// error already generated
if
self
.arg_types
[
i
]
.is_none
()
{
continue
}
// error already generated
let
name
=
self
.ecx
.ident_of
(
format!
(
"__arg{}"
,
i
));
let
e
=
self
.ecx
.expr_addr_of
(
e
.span
,
e
);
...
...
@@ -601,7 +601,7 @@ fn to_expr(&self, extra: @ast::Expr) -> @ast::Expr {
self
.ecx
.expr_ident
(
e
.span
,
name
)));
}
for
(
&
name
,
&
e
)
in
self
.names
.iter
()
{
if
!
self
.name_types
.contains_key
(
&
name
)
{
loop
}
if
!
self
.name_types
.contains_key
(
&
name
)
{
continue
}
let
lname
=
self
.ecx
.ident_of
(
format!
(
"__arg{}"
,
name
));
let
e
=
self
.ecx
.expr_addr_of
(
e
.span
,
e
);
...
...
src/libsyntax/parse/lexer.rs
浏览文件 @
4f67dcb2
...
...
@@ -431,7 +431,7 @@ fn scan_digits(rdr: @mut StringReader, radix: uint) -> ~str {
let
mut
rslt
=
~
""
;
loop
{
let
c
=
rdr
.curr
;
if
c
==
'_'
{
bump
(
rdr
);
loop
;
}
if
c
==
'_'
{
bump
(
rdr
);
continue
;
}
match
char
::
to_digit
(
c
,
radix
)
{
Some
(
_
)
=>
{
rslt
.push_char
(
c
);
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
4f67dcb2
...
...
@@ -1987,7 +1987,7 @@ pub fn parse_dot_or_call_expr_with(&self, e0: @Expr) -> @Expr {
}
_
=>
self
.unexpected
()
}
loop
;
continue
;
}
if
self
.expr_is_complete
(
e
)
{
break
;
}
match
*
self
.token
{
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
4f67dcb2
...
...
@@ -1406,7 +1406,7 @@ fn print_field(s: @ps, field: &ast::Field) {
}
}
ast
::
ExprAgain
(
opt_ident
)
=>
{
word
(
s
.s
,
"
loop
"
);
word
(
s
.s
,
"
continue
"
);
space
(
s
.s
);
for
ident
in
opt_ident
.iter
()
{
word
(
s
.s
,
"'"
);
...
...
src/test/bench/shootout-k-nucleotide-pipes.rs
浏览文件 @
4f67dcb2
...
...
@@ -196,7 +196,7 @@ fn main() {
while
!
rdr
.eof
()
{
let
line
:
~
str
=
rdr
.read_line
();
if
line
.len
()
==
0u
{
loop
;
}
if
line
.len
()
==
0u
{
continue
;
}
match
(
line
[
0
]
as
char
,
proc_mode
)
{
...
...
src/test/bench/shootout-reverse-complement.rs
浏览文件 @
4f67dcb2
...
...
@@ -130,7 +130,7 @@ fn main() {
stdout
);
pos
=
0
;
loop
;
continue
;
}
// Complement other lines.
...
...
src/test/compile-fail/borrowck-lend-flow-loop.rs
浏览文件 @
4f67dcb2
...
...
@@ -135,7 +135,7 @@ fn loop_loop_pops_scopes<'r>(_v: &'r mut [uint], f: &fn(&'r mut uint) -> bool) {
// this borrow is limited to the scope of `r`...
let
r
:
&
'r
mut
uint
=
produce
();
if
!
f
(
&
mut
*
r
)
{
loop
;
// ...so it is not live as exit (and re-enter) the `while` loop here
continue
;
// ...so it is not live as exit (and re-enter) the `while` loop here
}
}
}
...
...
src/test/run-pass/break.rs
浏览文件 @
4f67dcb2
...
...
@@ -19,15 +19,15 @@ pub fn main() {
if
*
x
==
3
{
break
;
}
assert
!
((
*
x
<=
3
));
}
i
=
0
;
while
i
<
10
{
i
+=
1
;
if
i
%
2
==
0
{
loop
;
}
assert
!
((
i
%
2
!=
0
));
}
while
i
<
10
{
i
+=
1
;
if
i
%
2
==
0
{
continue
;
}
assert
!
((
i
%
2
!=
0
));
}
i
=
0
;
loop
{
i
+=
1
;
if
i
%
2
==
0
{
loop
;
}
assert
!
((
i
%
2
!=
0
));
i
+=
1
;
if
i
%
2
==
0
{
continue
;
}
assert
!
((
i
%
2
!=
0
));
if
i
>=
10
{
break
;
}
}
let
ys
=
~
[
1
,
2
,
3
,
4
,
5
,
6
];
for
x
in
ys
.iter
()
{
if
*
x
%
2
==
0
{
loop
;
}
if
*
x
%
2
==
0
{
continue
;
}
assert
!
((
*
x
%
2
!=
0
));
}
}
src/test/run-pass/foreach-external-iterators-loop.rs
浏览文件 @
4f67dcb2
...
...
@@ -13,7 +13,7 @@ pub fn main() {
let
mut
y
=
0
;
for
(
n
,
i
)
in
x
.iter
()
.enumerate
()
{
if
n
<
10
{
loop
;
continue
;
}
y
+=
*
i
;
}
...
...
src/test/run-pass/issue-2216.rs
浏览文件 @
4f67dcb2
...
...
@@ -21,7 +21,7 @@ pub fn main() {
break
'bar
;
}
}
loop
'foo
;
continue
'foo
;
}
x
=
42
;
break
;
...
...
src/test/run-pass/loop-break-cont.rs
浏览文件 @
4f67dcb2
...
...
@@ -27,7 +27,7 @@ pub fn main() {
is_even
=
false
;
i
+=
1u
;
if
i
%
2u
!=
0u
{
loop
;
continue
;
}
is_even
=
true
;
}
...
...
@@ -40,7 +40,7 @@ pub fn main() {
is_even
=
false
;
i
+=
1u
;
if
i
%
2u
!=
0u
{
loop
;
continue
;
}
is_even
=
true
;
}
...
...
src/test/run-pass/terminate-in-initializer.rs
浏览文件 @
4f67dcb2
...
...
@@ -17,7 +17,7 @@
fn
test_break
()
{
loop
{
let
_
x
:
@
int
=
break
;
}
}
fn
test_cont
()
{
let
mut
i
=
0
;
while
i
<
1
{
i
+=
1
;
let
_
x
:
@
int
=
loop
;
}
}
fn
test_cont
()
{
let
mut
i
=
0
;
while
i
<
1
{
i
+=
1
;
let
_
x
:
@
int
=
continue
;
}
}
fn
test_ret
()
{
let
_
x
:
@
int
=
return
;
}
...
...
src/test/run-pass/weird-exprs.rs
浏览文件 @
4f67dcb2
...
...
@@ -67,7 +67,7 @@ fn p() -> bool { true }
fn
angrydome
()
{
loop
{
if
break
{
}
}
let
mut
i
=
0
;
loop
{
i
+=
1
;
if
i
==
1
{
match
(
loop
)
{
1
=>
{
},
_
=>
fail2!
(
"wat"
)
}
}
loop
{
i
+=
1
;
if
i
==
1
{
match
(
continue
)
{
1
=>
{
},
_
=>
fail2!
(
"wat"
)
}
}
break
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录