Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
30403204
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
30403204
编写于
10月 25, 2014
作者:
J
Joseph Crail
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix spelling mistakes in comments.
上级
f168c12c
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
24 addition
and
24 deletion
+24
-24
src/etc/emacs/rust-mode-tests.el
src/etc/emacs/rust-mode-tests.el
+1
-1
src/libcollections/btree/map.rs
src/libcollections/btree/map.rs
+2
-2
src/libcollections/btree/node.rs
src/libcollections/btree/node.rs
+9
-9
src/librand/chacha.rs
src/librand/chacha.rs
+1
-1
src/librustc/middle/traits/select.rs
src/librustc/middle/traits/select.rs
+1
-1
src/librustc/middle/trans/expr.rs
src/librustc/middle/trans/expr.rs
+2
-2
src/librustc/middle/ty.rs
src/librustc/middle/ty.rs
+2
-2
src/librustc/middle/typeck/check/regionck.rs
src/librustc/middle/typeck/check/regionck.rs
+1
-1
src/libstd/collections/hashmap/set.rs
src/libstd/collections/hashmap/set.rs
+1
-1
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+1
-1
src/test/run-pass/dst-coercions.rs
src/test/run-pass/dst-coercions.rs
+1
-1
src/test/run-pass/realloc-16687.rs
src/test/run-pass/realloc-16687.rs
+1
-1
src/test/run-pass/vec-dst.rs
src/test/run-pass/vec-dst.rs
+1
-1
未找到文件。
src/etc/emacs/rust-mode-tests.el
浏览文件 @
30403204
...
...
@@ -376,7 +376,7 @@ fn bar( a:int,
-> int
{ }
fn baz( a:int, // shou
dl
work with a comment here
fn baz( a:int, // shou
ld
work with a comment here
b:char)
-> int
{ }
...
...
src/libcollections/btree/map.rs
浏览文件 @
30403204
...
...
@@ -41,10 +41,10 @@
/// the BST strategy.
///
/// A B-Tree instead makes each node contain B-1 to 2B-1 elements in a contiguous array. By doing
/// this, we reduce the number of allocations by a factor of B, and improve cache eff
e
ciency in
/// this, we reduce the number of allocations by a factor of B, and improve cache eff
i
ciency in
/// searches. However, this does mean that searches will have to do *more* comparisons on average.
/// The precise number of comparisons depends on the node search strategy used. For optimal cache
/// eff
e
ciency, one could search the nodes linearly. For optimal comparisons, one could search
/// eff
i
ciency, one could search the nodes linearly. For optimal comparisons, one could search
/// the node using binary search. As a compromise, one could also perform a linear search
/// that initially only checks every i<sup>th</sup> element for some choice of i.
///
...
...
src/libcollections/btree/node.rs
浏览文件 @
30403204
...
...
@@ -53,7 +53,7 @@ pub struct Node<K, V> {
// hard. For now, we accept this cost in the name of correctness and simplicity.
//
// As a compromise, keys and vals could be merged into one Vec<(K, V)>, which would shave
// off 3 words, but possibly hurt our cache eff
e
ciency during search, which only cares about
// off 3 words, but possibly hurt our cache eff
i
ciency during search, which only cares about
// keys. This would also avoid the Zip we use in our iterator implementations. This is
// probably worth investigating.
//
...
...
@@ -72,7 +72,7 @@ impl<K: Ord, V> Node<K, V> {
/// `GoDown` will be yielded with the index of the subtree the key must lie in.
pub
fn
search
(
&
self
,
key
:
&
K
)
->
SearchResult
{
// FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
// For the B configured as of this writing (B = 6), binary search was *si
n
gnificantly*
// For the B configured as of this writing (B = 6), binary search was *significantly*
// worse for uints.
self
.search_linear
(
key
)
}
...
...
@@ -375,7 +375,7 @@ unsafe fn handle_underflow_to_right(&mut self, underflowed_child_index: uint) {
}
}
/// Steal! Stealing is roughly anal
a
gous to a binary tree rotation.
/// Steal! Stealing is roughly anal
o
gous to a binary tree rotation.
/// In this case, we're "rotating" right.
unsafe
fn
steal_to_left
(
&
mut
self
,
underflowed_child_index
:
uint
)
{
// Take the biggest stuff off left
...
...
@@ -387,7 +387,7 @@ unsafe fn steal_to_left(&mut self, underflowed_child_index: uint) {
}
};
// Swap the parent's sep
e
rating key-value pair with left's
// Swap the parent's sep
a
rating key-value pair with left's
self
.unsafe_swap
(
underflowed_child_index
-
1
,
&
mut
key
,
&
mut
val
);
// Put them at the start of right
...
...
@@ -402,7 +402,7 @@ unsafe fn steal_to_left(&mut self, underflowed_child_index: uint) {
}
}
/// Steal! Stealing is roughly anal
a
gous to a binary tree rotation.
/// Steal! Stealing is roughly anal
o
gous to a binary tree rotation.
/// In this case, we're "rotating" left.
unsafe
fn
steal_to_right
(
&
mut
self
,
underflowed_child_index
:
uint
)
{
// Take the smallest stuff off right
...
...
@@ -414,7 +414,7 @@ unsafe fn steal_to_right(&mut self, underflowed_child_index: uint) {
}
};
// Swap the parent's sep
e
rating key-value pair with right's
// Swap the parent's sep
a
rating key-value pair with right's
self
.unsafe_swap
(
underflowed_child_index
,
&
mut
key
,
&
mut
val
);
// Put them at the end of left
...
...
@@ -430,9 +430,9 @@ unsafe fn steal_to_right(&mut self, underflowed_child_index: uint) {
}
/// Merge! Left and right will be smooshed into one node, along with the key-value
/// pair that sep
e
rated them in their parent.
/// pair that sep
a
rated them in their parent.
unsafe
fn
merge_children
(
&
mut
self
,
left_index
:
uint
)
{
// Permanently remove right's index, and the key-value pair that sep
e
rates
// Permanently remove right's index, and the key-value pair that sep
a
rates
// left and right
let
(
key
,
val
,
right
)
=
{
match
(
self
.keys
.remove
(
left_index
),
...
...
@@ -448,7 +448,7 @@ unsafe fn merge_children(&mut self, left_index: uint) {
left
.absorb
(
key
,
val
,
right
);
}
/// Take all the values from right, sep
e
rated by the given key and value
/// Take all the values from right, sep
a
rated by the given key and value
fn
absorb
(
&
mut
self
,
key
:
K
,
val
:
V
,
right
:
Node
<
K
,
V
>
)
{
// Just as a sanity check, make sure we can fit this guy in
debug_assert!
(
self
.len
()
+
right
.len
()
<=
self
.capacity
())
...
...
src/librand/chacha.rs
浏览文件 @
30403204
...
...
@@ -173,7 +173,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng {
fn
reseed
(
&
mut
self
,
seed
:
&
'a
[
u32
])
{
// reset state
self
.init
(
&
[
0u32
,
..
KEY_WORDS
]);
// set key inplace
// set key in
place
let
key
=
self
.state
.slice_mut
(
4
,
4
+
KEY_WORDS
);
for
(
k
,
s
)
in
key
.iter_mut
()
.zip
(
seed
.iter
())
{
*
k
=
*
s
;
...
...
src/librustc/middle/traits/select.rs
浏览文件 @
30403204
...
...
@@ -211,7 +211,7 @@ pub fn select_inherent_impl(&mut self,
// can be applied to particular types. It skips the "confirmation"
// step and hence completely ignores output type parameters.
//
// The result is "true" if the obliation *may* hold and "false" if
// The result is "true" if the obli
g
ation *may* hold and "false" if
// we can be sure it does not.
pub
fn
evaluate_obligation_intercrate
(
&
mut
self
,
...
...
src/librustc/middle/trans/expr.rs
浏览文件 @
30403204
...
...
@@ -2117,7 +2117,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
deref_owned_pointer
(
bcx
,
expr
,
datum
,
content_ty
)
}
else
{
// A fat pointer and an opened DST value have the same
// represenation just different types. Since there is no
// represen
t
ation just different types. Since there is no
// temporary for `*e` here (because it is unsized), we cannot
// emulate the sized object code path for running drop glue and
// free. Instead, we schedule cleanup for `e`, turning it into
...
...
@@ -2142,7 +2142,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// owner (or, in the case of *T, by the user).
DatumBlock
::
new
(
bcx
,
Datum
::
new
(
ptr
,
content_ty
,
LvalueExpr
))
}
else
{
// A fat pointer and an opened DST value have the same represenation
// A fat pointer and an opened DST value have the same represen
t
ation
// just different types.
DatumBlock
::
new
(
bcx
,
Datum
::
new
(
datum
.val
,
ty
::
mk_open
(
bcx
.tcx
(),
content_ty
),
...
...
src/librustc/middle/ty.rs
浏览文件 @
30403204
...
...
@@ -3605,7 +3605,7 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
// Special case: A unit like struct's constructor must be called without () at the
// end (like `UnitStruct`) which means this is an ExprPath to a DefFn. But in case
// of unit structs this is should not be interprete
t
as function pointer but as
// of unit structs this is should not be interprete
d
as function pointer but as
// call to the constructor.
def
::
DefFn
(
_
,
_
,
true
)
=>
RvalueDpsExpr
,
...
...
@@ -5409,7 +5409,7 @@ pub fn to_mutbl_lossy(self) -> ast::Mutability {
MutBorrow
=>
ast
::
MutMutable
,
ImmBorrow
=>
ast
::
MutImmutable
,
// We have no type correponding to a unique imm borrow, so
// We have no type corre
s
ponding to a unique imm borrow, so
// use `&mut`. It gives all the capabilities of an `&uniq`
// and hence is a safe "over approximation".
UniqueImmBorrow
=>
ast
::
MutMutable
,
...
...
src/librustc/middle/typeck/check/regionck.rs
浏览文件 @
30403204
...
...
@@ -1675,7 +1675,7 @@ fn link_reborrowed_region(rcx: &Rcx,
//
// If mutability was inferred from an upvar, we may be
// forced to revisit this decision later if processing
// another borrow or nested closure ends up coverting the
// another borrow or nested closure ends up co
n
verting the
// upvar borrow kind to mutable/unique. Record the
// information needed to perform the recursive link in the
// maybe link map.
...
...
src/libstd/collections/hashmap/set.rs
浏览文件 @
30403204
...
...
@@ -186,7 +186,7 @@ pub fn reserve(&mut self, n: uint) {
/// # Example
///
/// This is a slightly silly example where we define the number's
/// parity as the equiv
i
lance class. It is important that the
/// parity as the equiv
a
lance class. It is important that the
/// values hash the same, which is why we implement `Hash`.
///
/// ```
...
...
src/libsyntax/ast.rs
浏览文件 @
30403204
...
...
@@ -436,7 +436,7 @@ pub enum Stmt_ {
/// Expr with trailing semi-colon (may have any type):
StmtSemi
(
P
<
Expr
>
,
NodeId
),
/// bool: is there a trailing sem-colon?
/// bool: is there a trailing sem
i
-colon?
StmtMac
(
Mac
,
bool
),
}
...
...
src/test/run-pass/dst-coercions.rs
浏览文件 @
30403204
...
...
@@ -28,7 +28,7 @@ pub fn main() {
let
x
:
*
mut
S
=
&
mut
S
;
// Test we can ch
na
ge the mutability from mut to const.
// Test we can ch
an
ge the mutability from mut to const.
let
x
:
&
T
=
&
mut
S
;
let
x
:
*
const
T
=
&
mut
S
;
}
src/test/run-pass/realloc-16687.rs
浏览文件 @
30403204
...
...
@@ -30,7 +30,7 @@ unsafe fn test_triangle() -> bool {
let
ascend
=
ascend
.as_mut_slice
();
static
ALIGN
:
uint
=
1
;
// Checks that `ascend` forms triangle of acending size formed
// Checks that `ascend` forms triangle of a
s
cending size formed
// from pairs of rows (where each pair of rows is equally sized),
// and the elements of the triangle match their row-pair index.
unsafe
fn
sanity_check
(
ascend
:
&
[
*
mut
u8
])
{
...
...
src/test/run-pass/vec-dst.rs
浏览文件 @
30403204
...
...
@@ -10,7 +10,7 @@
fn
sub_expr
()
{
// Test for a &[T] => &&[T] coercion in sub-expression position
// (surpisingly, this can cause errors which are not caused by either of:
// (surp
r
isingly, this can cause errors which are not caused by either of:
// `let x = vec.slice_mut(0, 2);`
// `foo(vec.slice_mut(0, 2));` ).
let
mut
vec
:
Vec
<
int
>
=
vec!
(
1
,
2
,
3
,
4
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录