Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d7f97e30
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,发现更多精彩内容 >>
提交
d7f97e30
编写于
1月 28, 2014
作者:
X
xales
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename std::borrow to std::reference.
Fixes #11814
上级
f84b7291
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
13 deletion
+13
-13
src/libextra/arc.rs
src/libextra/arc.rs
+2
-2
src/libextra/sync.rs
src/libextra/sync.rs
+2
-2
src/libstd/lib.rs
src/libstd/lib.rs
+1
-1
src/libstd/reference.rs
src/libstd/reference.rs
+0
-0
src/libstd/rt/task.rs
src/libstd/rt/task.rs
+2
-2
src/test/run-pass/borrowck-borrow-from-expr-block.rs
src/test/run-pass/borrowck-borrow-from-expr-block.rs
+3
-3
src/test/run-pass/cast-region-to-uint.rs
src/test/run-pass/cast-region-to-uint.rs
+3
-3
未找到文件。
src/libextra/arc.rs
浏览文件 @
d7f97e30
...
...
@@ -47,7 +47,7 @@
use
std
::
cast
;
use
std
::
sync
::
arc
::
UnsafeArc
;
use
std
::
task
;
use
std
::
borrow
;
use
std
::
reference
;
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
pub
struct
Condvar
<
'a
>
{
...
...
@@ -465,7 +465,7 @@ pub fn downgrade<'a>(&self, token: RWWriteMode<'a, T>)
// of this cast is removing the mutability.)
let
new_data
=
data
;
// Downgrade ensured the token belonged to us. Just a sanity check.
assert
!
(
borrow
::
ref_eq
(
&
(
*
state
)
.data
,
new_data
));
assert
!
(
reference
::
ref_eq
(
&
(
*
state
)
.data
,
new_data
));
// Produce new token
RWReadMode
{
data
:
new_data
,
...
...
src/libextra/sync.rs
浏览文件 @
d7f97e30
...
...
@@ -18,7 +18,7 @@
*/
use
std
::
borrow
;
use
std
::
reference
;
use
std
::
comm
;
use
std
::
unstable
::
sync
::
Exclusive
;
use
std
::
sync
::
arc
::
UnsafeArc
;
...
...
@@ -634,7 +634,7 @@ pub fn write_downgrade<U>(&self, blk: |v: RWLockWriteMode| -> U) -> U {
/// To be called inside of the write_downgrade block.
pub
fn
downgrade
<
'a
>
(
&
self
,
token
:
RWLockWriteMode
<
'a
>
)
->
RWLockReadMode
<
'a
>
{
if
!
borrow
::
ref_eq
(
self
,
token
.lock
)
{
if
!
reference
::
ref_eq
(
self
,
token
.lock
)
{
fail
!
(
"Can't downgrade() with a different rwlock's write_mode!"
);
}
unsafe
{
...
...
src/libstd/lib.rs
浏览文件 @
d7f97e30
...
...
@@ -123,7 +123,7 @@
pub
mod
ptr
;
pub
mod
owned
;
pub
mod
managed
;
pub
mod
borrow
;
pub
mod
reference
;
pub
mod
rc
;
pub
mod
gc
;
...
...
src/libstd/
borrow
.rs
→
src/libstd/
reference
.rs
浏览文件 @
d7f97e30
文件已移动
src/libstd/rt/task.rs
浏览文件 @
d7f97e30
...
...
@@ -14,7 +14,7 @@
//! to implement this.
use
any
::
AnyOwnExt
;
use
borrow
;
use
reference
;
use
cast
;
use
cleanup
;
use
clone
::
Clone
;
...
...
@@ -287,7 +287,7 @@ pub fn stack_bounds(&self) -> (uint, uint) {
impl
Drop
for
Task
{
fn
drop
(
&
mut
self
)
{
rtdebug!
(
"called drop for a task: {}"
,
borrow
::
to_uint
(
self
));
rtdebug!
(
"called drop for a task: {}"
,
reference
::
to_uint
(
self
));
rtassert!
(
self
.destroyed
);
}
}
...
...
src/test/run-pass/borrowck-borrow-from-expr-block.rs
浏览文件 @
d7f97e30
// Copyright 201
2-2013
The Rust Project Developers. See the COPYRIGHT
// Copyright 201
4
The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
...
...
@@ -10,7 +10,7 @@
#[feature(managed_boxes)]
;
use
std
::
borrow
;
use
std
::
reference
;
use
std
::
ptr
;
fn
borrow
(
x
:
&
int
,
f
:
|
x
:
&
int
|)
{
...
...
@@ -20,7 +20,7 @@ fn borrow(x: &int, f: |x: &int|) {
fn
test1
(
x
:
@~
int
)
{
borrow
(
&*
(
*
x
)
.clone
(),
|
p
|
{
let
x_a
=
ptr
::
to_unsafe_ptr
(
&**
x
);
assert
!
((
x_a
as
uint
)
!=
borrow
::
to_uint
(
p
));
assert
!
((
x_a
as
uint
)
!=
reference
::
to_uint
(
p
));
assert_eq!
(
unsafe
{
*
x_a
},
*
p
);
})
}
...
...
src/test/run-pass/cast-region-to-uint.rs
浏览文件 @
d7f97e30
// Copyright 201
2
The Rust Project Developers. See the COPYRIGHT
// Copyright 201
4
The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
...
...
@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use
std
::
borrow
;
use
std
::
reference
;
pub
fn
main
()
{
let
x
=
3
;
info!
(
"&x={:x}"
,
borrow
::
to_uint
(
&
x
));
info!
(
"&x={:x}"
,
reference
::
to_uint
(
&
x
));
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录