Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e3ca81fd
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,发现更多精彩内容 >>
提交
e3ca81fd
编写于
6月 14, 2021
作者:
L
LeSeulArtichaut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the now available implementation of `IntoIterator` for arrays
上级
a216131c
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
34 addition
and
34 deletion
+34
-34
compiler/rustc_apfloat/tests/ieee.rs
compiler/rustc_apfloat/tests/ieee.rs
+4
-4
compiler/rustc_apfloat/tests/ppc.rs
compiler/rustc_apfloat/tests/ppc.rs
+10
-10
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_ast_lowering/src/lib.rs
+1
-1
compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
+1
-1
compiler/rustc_expand/src/parse/tests.rs
compiler/rustc_expand/src/parse/tests.rs
+1
-1
compiler/rustc_infer/src/infer/region_constraints/mod.rs
compiler/rustc_infer/src/infer/region_constraints/mod.rs
+1
-1
compiler/rustc_passes/src/stability.rs
compiler/rustc_passes/src/stability.rs
+1
-1
compiler/rustc_serialize/tests/json.rs
compiler/rustc_serialize/tests/json.rs
+1
-1
compiler/rustc_session/src/config.rs
compiler/rustc_session/src/config.rs
+2
-2
compiler/rustc_target/src/abi/call/x86_64.rs
compiler/rustc_target/src/abi/call/x86_64.rs
+1
-1
compiler/rustc_target/src/abi/mod.rs
compiler/rustc_target/src/abi/mod.rs
+2
-2
compiler/rustc_typeck/src/check/callee.rs
compiler/rustc_typeck/src/check/callee.rs
+1
-1
compiler/rustc_typeck/src/check/compare_method.rs
compiler/rustc_typeck/src/check/compare_method.rs
+1
-1
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
+1
-1
compiler/rustc_typeck/src/check/method/probe.rs
compiler/rustc_typeck/src/check/method/probe.rs
+1
-1
compiler/rustc_typeck/src/check/place_op.rs
compiler/rustc_typeck/src/check/place_op.rs
+1
-1
src/librustdoc/passes/collect_intra_doc_links.rs
src/librustdoc/passes/collect_intra_doc_links.rs
+4
-4
未找到文件。
compiler/rustc_apfloat/tests/ieee.rs
浏览文件 @
e3ca81fd
...
...
@@ -1939,7 +1939,7 @@ fn add() {
(
m_smallest_normalized
,
m_smallest_normalized
,
"-0x1p-125"
,
Status
::
OK
,
Category
::
Normal
),
];
for
&
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
&
special_cases
[
..
]
{
for
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
special_cases
{
let
status
;
let
result
=
unpack!
(
status
=
,
x
+
y
);
assert_eq!
(
status
,
e_status
);
...
...
@@ -2262,7 +2262,7 @@ fn subtract() {
(
m_smallest_normalized
,
m_smallest_normalized
,
"0x0p+0"
,
Status
::
OK
,
Category
::
Zero
),
];
for
&
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
&
special_cases
[
..
]
{
for
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
special_cases
{
let
status
;
let
result
=
unpack!
(
status
=
,
x
-
y
);
assert_eq!
(
status
,
e_status
);
...
...
@@ -2538,7 +2538,7 @@ fn multiply() {
(
m_smallest_normalized
,
m_smallest_normalized
,
"0x0p+0"
,
underflow_status
,
Category
::
Zero
),
];
for
&
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
&
special_cases
[
..
]
{
for
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
special_cases
{
let
status
;
let
result
=
unpack!
(
status
=
,
x
*
y
);
assert_eq!
(
status
,
e_status
);
...
...
@@ -2814,7 +2814,7 @@ fn divide() {
(
m_smallest_normalized
,
m_smallest_normalized
,
"0x1p+0"
,
Status
::
OK
,
Category
::
Normal
),
];
for
&
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
&
special_cases
[
..
]
{
for
(
x
,
y
,
e_result
,
e_status
,
e_category
)
in
special_cases
{
let
status
;
let
result
=
unpack!
(
status
=
,
x
/
y
);
assert_eq!
(
status
,
e_status
);
...
...
compiler/rustc_apfloat/tests/ppc.rs
浏览文件 @
e3ca81fd
...
...
@@ -64,7 +64,7 @@ fn ppc_double_double_add_special() {
(
0x7ff8000000000000
,
0x3ff0000000000000
,
Category
::
NaN
,
Round
::
NearestTiesToEven
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
...
...
@@ -135,7 +135,7 @@ fn ppc_double_double_add() {
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
...
...
@@ -172,7 +172,7 @@ fn ppc_double_double_subtract() {
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
a1
=
a1
.sub_r
(
a2
,
round
)
.value
;
...
...
@@ -204,7 +204,7 @@ fn ppc_double_double_multiply_special() {
(
0
,
0x3ff0000000000000
,
Category
::
Zero
,
Round
::
NearestTiesToEven
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
...
...
@@ -290,7 +290,7 @@ fn ppc_double_double_multiply() {
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
...
...
@@ -322,7 +322,7 @@ fn ppc_double_double_divide() {
),
];
for
&
(
op1
,
op2
,
expected
,
round
)
in
&
data
{
for
(
op1
,
op2
,
expected
,
round
)
in
data
{
let
mut
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
a1
=
a1
.div_r
(
a2
,
round
)
.value
;
...
...
@@ -348,7 +348,7 @@ fn ppc_double_double_remainder() {
),
];
for
&
(
op1
,
op2
,
expected
)
in
&
data
{
for
(
op1
,
op2
,
expected
)
in
data
{
let
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
let
result
=
a1
.ieee_rem
(
a2
)
.value
;
...
...
@@ -376,7 +376,7 @@ fn ppc_double_double_mod() {
),
];
for
&
(
op1
,
op2
,
expected
)
in
&
data
{
for
(
op1
,
op2
,
expected
)
in
data
{
let
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
let
r
=
(
a1
%
a2
)
.value
;
...
...
@@ -426,7 +426,7 @@ fn ppc_double_double_compare() {
(
0x7ff0000000000000
,
0x7ff0000000000000
,
Some
(
Ordering
::
Equal
)),
];
for
&
(
op1
,
op2
,
expected
)
in
&
data
{
for
(
op1
,
op2
,
expected
)
in
data
{
let
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
assert_eq!
(
expected
,
a1
.partial_cmp
(
&
a2
),
"compare({:#x}, {:#x})"
,
op1
,
op2
,);
...
...
@@ -448,7 +448,7 @@ fn ppc_double_double_bitwise_eq() {
(
0x7ff0000000000000
,
0x7ff0000000000000
,
true
),
];
for
&
(
op1
,
op2
,
expected
)
in
&
data
{
for
(
op1
,
op2
,
expected
)
in
data
{
let
a1
=
DoubleDouble
::
from_bits
(
op1
);
let
a2
=
DoubleDouble
::
from_bits
(
op2
);
assert_eq!
(
expected
,
a1
.bitwise_eq
(
a2
),
"{:#x} = {:#x}"
,
op1
,
op2
);
...
...
compiler/rustc_ast_lowering/src/lib.rs
浏览文件 @
e3ca81fd
...
...
@@ -417,7 +417,7 @@ impl MiscCollector<'_, '_, '_> {
fn
allocate_use_tree_hir_id_counters
(
&
mut
self
,
tree
:
&
UseTree
)
{
match
tree
.kind
{
UseTreeKind
::
Simple
(
_
,
id1
,
id2
)
=>
{
for
&
id
in
&
[
id1
,
id2
]
{
for
id
in
[
id1
,
id2
]
{
self
.lctx
.allocate_hir_id_counter
(
id
);
}
}
...
...
compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
浏览文件 @
e3ca81fd
...
...
@@ -7,7 +7,7 @@
#[cfg(feature
=
"jit"
)]
pub
(
crate
)
fn
$
register
(
builder
:
&
mut
cranelift_jit
::
JITBuilder
)
{
for
&
(
name
,
val
)
in
&
[
$
((
stringify!
(
$
name
),
$
name
as
*
const
u8
)),
*
]
{
for
(
name
,
val
)
in
[
$
((
stringify!
(
$
name
),
$
name
as
*
const
u8
)),
*
]
{
builder
.symbol
(
name
,
val
);
}
}
...
...
compiler/rustc_expand/src/parse/tests.rs
浏览文件 @
e3ca81fd
...
...
@@ -193,7 +193,7 @@ fn span_of_self_arg_pat_idents_are_correct() {
"impl z { fn a (self: Foo, &myarg: i32) {} }"
,
];
for
&
src
in
&
srcs
{
for
src
in
srcs
{
let
spans
=
get_spans_of_pat_idents
(
src
);
let
(
lo
,
hi
)
=
(
spans
[
0
]
.lo
(),
spans
[
0
]
.hi
());
assert
!
(
...
...
compiler/rustc_infer/src/infer/region_constraints/mod.rs
浏览文件 @
e3ca81fd
...
...
@@ -674,7 +674,7 @@ fn combine_vars(
self
.combine_map
(
t
)
.insert
(
vars
,
c
);
self
.undo_log
.push
(
AddCombination
(
t
,
vars
));
let
new_r
=
tcx
.mk_region
(
ReVar
(
c
));
for
&
old_r
in
&
[
a
,
b
]
{
for
old_r
in
[
a
,
b
]
{
match
t
{
Glb
=>
self
.make_subregion
(
origin
.clone
(),
new_r
,
old_r
),
Lub
=>
self
.make_subregion
(
origin
.clone
(),
old_r
,
new_r
),
...
...
compiler/rustc_passes/src/stability.rs
浏览文件 @
e3ca81fd
...
...
@@ -938,7 +938,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
if
!
remaining_lib_features
.is_empty
()
{
check_features
(
&
mut
remaining_lib_features
,
&
local_defined_features
);
for
&
cnum
in
&*
tcx
.crates
()
{
for
&
cnum
in
tcx
.crates
()
{
if
remaining_lib_features
.is_empty
()
{
break
;
}
...
...
compiler/rustc_serialize/tests/json.rs
浏览文件 @
e3ca81fd
...
...
@@ -437,7 +437,7 @@ fn test_decode_str() {
(
"
\"\\
uAB12
\"
"
,
"
\
u{AB12}"
),
];
for
&
(
i
,
o
)
in
&
s
{
for
(
i
,
o
)
in
s
{
let
v
:
string
::
String
=
json
::
decode
(
i
)
.unwrap
();
assert_eq!
(
v
,
o
);
}
...
...
compiler/rustc_session/src/config.rs
浏览文件 @
e3ca81fd
...
...
@@ -833,7 +833,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
if
sess
.target.has_elf_tls
{
ret
.insert
((
sym
::
target_thread_local
,
None
));
}
for
&
(
i
,
align
)
in
&
[
for
(
i
,
align
)
in
[
(
8
,
layout
.i8_align.abi
),
(
16
,
layout
.i16_align.abi
),
(
32
,
layout
.i32_align.abi
),
...
...
@@ -1169,7 +1169,7 @@ pub fn get_cmd_lint_options(
let
mut
lint_opts_with_position
=
vec!
[];
let
mut
describe_lints
=
false
;
for
&
level
in
&
[
lint
::
Allow
,
lint
::
Warn
,
lint
::
Deny
,
lint
::
Forbid
]
{
for
level
in
[
lint
::
Allow
,
lint
::
Warn
,
lint
::
Deny
,
lint
::
Forbid
]
{
for
(
passed_arg_pos
,
lint_name
)
in
matches
.opt_strs_pos
(
level
.as_str
())
{
let
arg_pos
=
if
let
lint
::
Forbid
=
level
{
// HACK: forbid is always specified last, so it can't be overridden.
...
...
compiler/rustc_target/src/abi/call/x86_64.rs
浏览文件 @
e3ca81fd
...
...
@@ -185,7 +185,7 @@ pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
if
let
Ok
(
cls
)
=
cls_or_mem
{
let
mut
needed_int
=
0
;
let
mut
needed_sse
=
0
;
for
&
c
in
&
cls
{
for
c
in
cls
{
match
c
{
Some
(
Class
::
Int
)
=>
needed_int
+=
1
,
Some
(
Class
::
Sse
)
=>
needed_sse
+=
1
,
...
...
compiler/rustc_target/src/abi/mod.rs
浏览文件 @
e3ca81fd
...
...
@@ -590,7 +590,7 @@ pub fn fit_unsigned(x: u128) -> Integer {
pub
fn
for_align
<
C
:
HasDataLayout
>
(
cx
:
&
C
,
wanted
:
Align
)
->
Option
<
Integer
>
{
let
dl
=
cx
.data_layout
();
for
&
candidate
in
&
[
I8
,
I16
,
I32
,
I64
,
I128
]
{
for
candidate
in
[
I8
,
I16
,
I32
,
I64
,
I128
]
{
if
wanted
==
candidate
.align
(
dl
)
.abi
&&
wanted
.bytes
()
==
candidate
.size
()
.bytes
()
{
return
Some
(
candidate
);
}
...
...
@@ -603,7 +603,7 @@ pub fn approximate_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Integer {
let
dl
=
cx
.data_layout
();
// FIXME(eddyb) maybe include I128 in the future, when it works everywhere.
for
&
candidate
in
&
[
I64
,
I32
,
I16
]
{
for
candidate
in
[
I64
,
I32
,
I16
]
{
if
wanted
>=
candidate
.align
(
dl
)
.abi
&&
wanted
.bytes
()
>=
candidate
.size
()
.bytes
()
{
return
candidate
;
}
...
...
compiler/rustc_typeck/src/check/callee.rs
浏览文件 @
e3ca81fd
...
...
@@ -205,7 +205,7 @@ fn try_overloaded_call_traits(
opt_arg_exprs
:
Option
<&
'tcx
[
hir
::
Expr
<
'tcx
>
]
>
,
)
->
Option
<
(
Option
<
Adjustment
<
'tcx
>>
,
MethodCallee
<
'tcx
>
)
>
{
// Try the options that are least restrictive on the caller first.
for
&
(
opt_trait_def_id
,
method_name
,
borrow
)
in
&
[
for
(
opt_trait_def_id
,
method_name
,
borrow
)
in
[
(
self
.tcx
.lang_items
()
.fn_trait
(),
Ident
::
with_dummy_span
(
sym
::
call
),
true
),
(
self
.tcx
.lang_items
()
.fn_mut_trait
(),
Ident
::
with_dummy_span
(
sym
::
call_mut
),
true
),
(
self
.tcx
.lang_items
()
.fn_once_trait
(),
Ident
::
with_dummy_span
(
sym
::
call_once
),
false
),
...
...
compiler/rustc_typeck/src/check/compare_method.rs
浏览文件 @
e3ca81fd
...
...
@@ -579,7 +579,7 @@ fn compare_number_of_generics<'tcx>(
let
item_kind
=
assoc_item_kind_str
(
impl_
);
let
mut
err_occurred
=
false
;
for
&
(
kind
,
trait_count
,
impl_count
)
in
&
matchings
{
for
(
kind
,
trait_count
,
impl_count
)
in
matchings
{
if
impl_count
!=
trait_count
{
err_occurred
=
true
;
...
...
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
浏览文件 @
e3ca81fd
...
...
@@ -291,7 +291,7 @@ pub(in super::super) fn check_argument_types(
// that are not closures, then we type-check the closures. This is so
// that we have more information about the types of arguments when we
// type-check the functions. This isn't really the right way to do this.
for
&
check_closures
in
&
[
false
,
true
]
{
for
check_closures
in
[
false
,
true
]
{
debug!
(
"check_closures={}"
,
check_closures
);
// More awful hacks: before we check argument types, try to do
...
...
compiler/rustc_typeck/src/check/method/probe.rs
浏览文件 @
e3ca81fd
...
...
@@ -668,7 +668,7 @@ fn assemble_probe(&mut self, self_ty: &Canonical<'tcx, QueryResponse<'tcx, Ty<'t
self
.assemble_inherent_impl_for_primitive
(
lang_def_id
);
}
ty
::
Slice
(
_
)
=>
{
for
&
lang_def_id
in
&
[
for
lang_def_id
in
[
lang_items
.slice_impl
(),
lang_items
.slice_u8_impl
(),
lang_items
.slice_alloc_impl
(),
...
...
compiler/rustc_typeck/src/check/place_op.rs
浏览文件 @
e3ca81fd
...
...
@@ -82,7 +82,7 @@ fn try_index_step(
expr
,
base_expr
,
adjusted_ty
,
index_ty
);
for
&
unsize
in
&
[
false
,
true
]
{
for
unsize
in
[
false
,
true
]
{
let
mut
self_ty
=
adjusted_ty
;
if
unsize
{
// We only unsize arrays here.
...
...
src/librustdoc/passes/collect_intra_doc_links.rs
浏览文件 @
e3ca81fd
...
...
@@ -1346,7 +1346,7 @@ fn resolve_with_disambiguator(
let
other_ns
=
if
expected_ns
==
ValueNS
{
TypeNS
}
else
{
ValueNS
};
// FIXME: really it should be `resolution_failure` that does this, not `resolve_with_disambiguator`
// See https://github.com/rust-lang/rust/pull/76955#discussion_r493953382 for a good approach
for
&
new_ns
in
&
[
other_ns
,
MacroNS
]
{
for
new_ns
in
[
other_ns
,
MacroNS
]
{
if
let
Some
(
res
)
=
self
.check_full_res
(
new_ns
,
path_str
,
base_node
,
extra_fragment
)
{
...
...
@@ -1444,7 +1444,7 @@ fn resolve_with_disambiguator(
Ok
(
res
)
=>
Some
((
res
,
extra_fragment
.clone
())),
Err
(
mut
kind
)
=>
{
// `resolve_macro` only looks in the macro namespace. Try to give a better error if possible.
for
&
ns
in
&
[
TypeNS
,
ValueNS
]
{
for
ns
in
[
TypeNS
,
ValueNS
]
{
if
let
Some
(
res
)
=
self
.check_full_res
(
ns
,
path_str
,
base_node
,
extra_fragment
)
{
...
...
@@ -1558,7 +1558,7 @@ fn from_str(link: &str) -> Result<Option<(Self, &str)>, (String, Range<usize>)>
(
"()"
,
DefKind
::
Fn
),
(
"!"
,
DefKind
::
Macro
(
MacroKind
::
Bang
)),
];
for
&
(
suffix
,
kind
)
in
&
suffixes
{
for
(
suffix
,
kind
)
in
suffixes
{
if
let
Some
(
link
)
=
link
.strip_suffix
(
suffix
)
{
// Avoid turning `!` or `()` into an empty string
if
!
link
.is_empty
()
{
...
...
@@ -1798,7 +1798,7 @@ fn split(path: &str) -> Option<(&str, &str)> {
break
;
};
name
=
start
;
for
&
ns
in
&
[
TypeNS
,
ValueNS
,
MacroNS
]
{
for
ns
in
[
TypeNS
,
ValueNS
,
MacroNS
]
{
if
let
Some
(
res
)
=
collector
.check_full_res
(
ns
,
&
start
,
module_id
.into
(),
&
None
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录