Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
93fa7a4b
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
93fa7a4b
编写于
7月 18, 2013
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc: Remove `&` inside `@` from borrowck/check_loans.
上级
bb8b83a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
17 deletion
+18
-17
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/check_loans.rs
+18
-17
未找到文件。
src/librustc/middle/borrowck/check_loans.rs
浏览文件 @
93fa7a4b
...
...
@@ -31,10 +31,11 @@
use
syntax
::
visit
;
use
util
::
ppaux
::
Repr
;
#[deriving(Clone)]
struct
CheckLoanCtxt
<
'self
>
{
bccx
:
@
BorrowckCtxt
,
dfcx_loans
:
&
'self
LoanDataFlow
,
move_data
:
move_data
::
FlowedMoveData
,
move_data
:
@
move_data
::
FlowedMoveData
,
all_loans
:
&
'self
[
Loan
],
reported
:
@
mut
HashSet
<
ast
::
node_id
>
,
}
...
...
@@ -46,10 +47,10 @@ pub fn check_loans(bccx: @BorrowckCtxt,
body
:
&
ast
::
blk
)
{
debug!
(
"check_loans(body id=%?)"
,
body
.id
);
let
clcx
=
@
mut
CheckLoanCtxt
{
let
clcx
=
CheckLoanCtxt
{
bccx
:
bccx
,
dfcx_loans
:
dfcx_loans
,
move_data
:
move_data
,
move_data
:
@
move_data
,
all_loans
:
all_loans
,
reported
:
@
mut
HashSet
::
new
(),
};
...
...
@@ -139,7 +140,7 @@ pub fn loans_generated_by(&self, scope_id: ast::node_id) -> ~[uint] {
return
result
;
}
pub
fn
check_for_conflicting_loans
(
&
mut
self
,
scope_id
:
ast
::
node_id
)
{
pub
fn
check_for_conflicting_loans
(
&
self
,
scope_id
:
ast
::
node_id
)
{
//! Checks to see whether any of the loans that are issued
//! by `scope_id` conflict with loans that have already been
//! issued when we enter `scope_id` (for example, we do not
...
...
@@ -596,7 +597,7 @@ pub fn analyze_move_out_from(&self,
MoveOk
}
pub
fn
check_call
(
&
mut
self
,
pub
fn
check_call
(
&
self
,
_
expr
:
@
ast
::
expr
,
_
callee
:
Option
<@
ast
::
expr
>
,
_
callee_id
:
ast
::
node_id
,
...
...
@@ -617,8 +618,8 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
body
:
&
ast
::
blk
,
sp
:
span
,
id
:
ast
::
node_id
,
(
this
,
visitor
):
(
@
mut
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
@
mut
CheckLoanCtxt
<
'a
>>
))
{
(
this
,
visitor
):
(
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
CheckLoanCtxt
<
'a
>>
))
{
match
*
fk
{
visit
::
fk_item_fn
(
*
)
|
visit
::
fk_method
(
*
)
=>
{
...
...
@@ -634,7 +635,7 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
visit
::
visit_fn
(
fk
,
decl
,
body
,
sp
,
id
,
(
this
,
visitor
));
fn
check_captured_variables
(
this
:
@
mut
CheckLoanCtxt
,
fn
check_captured_variables
(
this
:
CheckLoanCtxt
,
closure_id
:
ast
::
node_id
,
span
:
span
)
{
let
cap_vars
=
this
.bccx.capture_map
.get
(
&
closure_id
);
...
...
@@ -652,7 +653,7 @@ fn check_captured_variables(this: @mut CheckLoanCtxt,
}
return
;
fn
check_by_move_capture
(
this
:
@
mut
CheckLoanCtxt
,
fn
check_by_move_capture
(
this
:
CheckLoanCtxt
,
closure_id
:
ast
::
node_id
,
cap_var
:
&
moves
::
CaptureVar
,
move_path
:
@
LoanPath
)
{
...
...
@@ -676,14 +677,14 @@ fn check_by_move_capture(this: @mut CheckLoanCtxt,
}
fn
check_loans_in_local
<
'a
>
(
local
:
@
ast
::
local
,
(
this
,
vt
):
(
@
mut
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
@
mut
CheckLoanCtxt
<
'a
>>
))
{
(
this
,
vt
):
(
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
CheckLoanCtxt
<
'a
>>
))
{
visit
::
visit_local
(
local
,
(
this
,
vt
));
}
fn
check_loans_in_expr
<
'a
>
(
expr
:
@
ast
::
expr
,
(
this
,
vt
):
(
@
mut
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
@
mut
CheckLoanCtxt
<
'a
>>
))
{
(
this
,
vt
):
(
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
CheckLoanCtxt
<
'a
>>
))
{
visit
::
visit_expr
(
expr
,
(
this
,
vt
));
debug!
(
"check_loans_in_expr(expr=%s)"
,
...
...
@@ -736,8 +737,8 @@ fn check_loans_in_expr<'a>(expr: @ast::expr,
}
fn
check_loans_in_pat
<
'a
>
(
pat
:
@
ast
::
pat
,
(
this
,
vt
):
(
@
mut
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
@
mut
CheckLoanCtxt
<
'a
>>
))
(
this
,
vt
):
(
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
CheckLoanCtxt
<
'a
>>
))
{
this
.check_for_conflicting_loans
(
pat
.id
);
this
.check_move_out_from_id
(
pat
.id
,
pat
.span
);
...
...
@@ -745,8 +746,8 @@ fn check_loans_in_pat<'a>(pat: @ast::pat,
}
fn
check_loans_in_block
<
'a
>
(
blk
:
&
ast
::
blk
,
(
this
,
vt
):
(
@
mut
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
@
mut
CheckLoanCtxt
<
'a
>>
))
(
this
,
vt
):
(
CheckLoanCtxt
<
'a
>
,
visit
::
vt
<
CheckLoanCtxt
<
'a
>>
))
{
visit
::
visit_block
(
blk
,
(
this
,
vt
));
this
.check_for_conflicting_loans
(
blk
.id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录