Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0ef4e860
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,发现更多精彩内容 >>
提交
0ef4e860
编写于
5月 06, 2013
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace NOTE with FIXME
上级
c50a9d5b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
31 addition
and
29 deletion
+31
-29
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/check_loans.rs
+2
-2
src/librustc/middle/borrowck/gather_loans/mod.rs
src/librustc/middle/borrowck/gather_loans/mod.rs
+1
-1
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/borrowck/mod.rs
+1
-1
src/librustc/middle/dataflow.rs
src/librustc/middle/dataflow.rs
+1
-1
src/librustc/middle/region.rs
src/librustc/middle/region.rs
+1
-2
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/base.rs
+1
-1
src/librustc/middle/trans/expr.rs
src/librustc/middle/trans/expr.rs
+2
-1
src/librustc/middle/trans/reachable.rs
src/librustc/middle/trans/reachable.rs
+6
-6
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/mod.rs
+5
-6
src/librustc/middle/typeck/check/regionck.rs
src/librustc/middle/typeck/check/regionck.rs
+11
-8
未找到文件。
src/librustc/middle/borrowck/check_loans.rs
浏览文件 @
0ef4e860
...
@@ -579,7 +579,7 @@ fn analyze_move_out_from_cmt(&self, cmt: mc::cmt) -> MoveError {
...
@@ -579,7 +579,7 @@ fn analyze_move_out_from_cmt(&self, cmt: mc::cmt) -> MoveError {
}
}
}
}
//
NOTE
inadequare if/when we permit `move a.b`
//
FIXME(#4384)
inadequare if/when we permit `move a.b`
// check for a conflicting loan:
// check for a conflicting loan:
for
opt_loan_path
(
cmt
)
.each
|
&
lp
|
{
for
opt_loan_path
(
cmt
)
.each
|
&
lp
|
{
...
@@ -604,7 +604,7 @@ fn check_call(&mut self,
...
@@ -604,7 +604,7 @@ fn check_call(&mut self,
// However, I added it for consistency and lest the system
// However, I added it for consistency and lest the system
// should change in the future.
// should change in the future.
//
//
// FIXME(#
5074
) nested method calls
// FIXME(#
6268
) nested method calls
// self.check_for_conflicting_loans(callee_id);
// self.check_for_conflicting_loans(callee_id);
}
}
}
}
...
...
src/librustc/middle/borrowck/gather_loans/mod.rs
浏览文件 @
0ef4e860
...
@@ -389,7 +389,7 @@ fn guarantee_valid(&mut self,
...
@@ -389,7 +389,7 @@ fn guarantee_valid(&mut self,
self
.all_loans
.push
(
loan
);
self
.all_loans
.push
(
loan
);
// if loan_gen_scope != borrow_id {
// if loan_gen_scope != borrow_id {
//
NOTE handle case where gen_scope is not borrow_id
//
FIXME(#6268) Nested method calls
//
//
// Typically, the scope of the loan includes the point at
// Typically, the scope of the loan includes the point at
// which the loan is originated. This
// which the loan is originated. This
...
...
src/librustc/middle/borrowck/mod.rs
浏览文件 @
0ef4e860
...
@@ -516,7 +516,7 @@ fn report_aliasability_violation(&self,
...
@@ -516,7 +516,7 @@ fn report_aliasability_violation(&self,
fmt!
(
"%s in an aliasable location"
,
prefix
));
fmt!
(
"%s in an aliasable location"
,
prefix
));
}
}
mc
::
AliasableManaged
(
ast
::
m_mutbl
)
=>
{
mc
::
AliasableManaged
(
ast
::
m_mutbl
)
=>
{
// FIXME(#
5074) we should prob do this borrow
// FIXME(#
6269) reborrow @mut to &mut
self
.tcx.sess
.span_err
(
self
.tcx.sess
.span_err
(
span
,
span
,
fmt!
(
"%s in a `@mut` pointer;
\
fmt!
(
"%s in a `@mut` pointer;
\
...
...
src/librustc/middle/dataflow.rs
浏览文件 @
0ef4e860
...
@@ -808,7 +808,7 @@ fn walk_call(&mut self,
...
@@ -808,7 +808,7 @@ fn walk_call(&mut self,
self
.walk_expr
(
arg0
,
in_out
,
loop_scopes
);
self
.walk_expr
(
arg0
,
in_out
,
loop_scopes
);
self
.walk_exprs
(
args
,
in_out
,
loop_scopes
);
self
.walk_exprs
(
args
,
in_out
,
loop_scopes
);
// FIXME(#
5074
) nested method calls
// FIXME(#
6268
) nested method calls
// self.merge_with_entry_set(callee_id, in_out);
// self.merge_with_entry_set(callee_id, in_out);
// self.dfcx.apply_gen_kill(callee_id, in_out);
// self.dfcx.apply_gen_kill(callee_id, in_out);
...
...
src/librustc/middle/region.rs
浏览文件 @
0ef4e860
...
@@ -393,7 +393,7 @@ pub fn resolve_expr(expr: @ast::expr, cx: Context, visitor: visit::vt<Context>)
...
@@ -393,7 +393,7 @@ pub fn resolve_expr(expr: @ast::expr, cx: Context, visitor: visit::vt<Context>)
match
expr
.node
{
match
expr
.node
{
ast
::
expr_assign_op
(
*
)
|
ast
::
expr_index
(
*
)
|
ast
::
expr_binary
(
*
)
|
ast
::
expr_assign_op
(
*
)
|
ast
::
expr_index
(
*
)
|
ast
::
expr_binary
(
*
)
|
ast
::
expr_unary
(
*
)
|
ast
::
expr_call
(
*
)
|
ast
::
expr_method_call
(
*
)
=>
{
ast
::
expr_unary
(
*
)
|
ast
::
expr_call
(
*
)
|
ast
::
expr_method_call
(
*
)
=>
{
// FIXME(#
5074
) Nested method calls
// FIXME(#
6268
) Nested method calls
//
//
// The lifetimes for a call or method call look as follows:
// The lifetimes for a call or method call look as follows:
//
//
...
@@ -949,7 +949,6 @@ pub fn determine_rp_in_crate(sess: Session,
...
@@ -949,7 +949,6 @@ pub fn determine_rp_in_crate(sess: Session,
while
cx
.worklist
.len
()
!=
0
{
while
cx
.worklist
.len
()
!=
0
{
let
c_id
=
cx
.worklist
.pop
();
let
c_id
=
cx
.worklist
.pop
();
let
c_variance
=
cx
.region_paramd_items
.get_copy
(
&
c_id
);
let
c_variance
=
cx
.region_paramd_items
.get_copy
(
&
c_id
);
// NOTE cleanup scopes cause an exaggerated lock here
debug!
(
"popped %d from worklist"
,
c_id
);
debug!
(
"popped %d from worklist"
,
c_id
);
match
cx
.dep_map
.find
(
&
c_id
)
{
match
cx
.dep_map
.find
(
&
c_id
)
{
None
=>
{}
None
=>
{}
...
...
src/librustc/middle/trans/base.rs
浏览文件 @
0ef4e860
...
@@ -998,7 +998,7 @@ pub fn find_bcx_for_scope(bcx: block, scope_id: ast::node_id) -> block {
...
@@ -998,7 +998,7 @@ pub fn find_bcx_for_scope(bcx: block, scope_id: ast::node_id) -> block {
return
bcx_sid
return
bcx_sid
}
}
//
NOTE This is messier than it ought to be and not really right
//
FIXME(#6268, #6248) hacky cleanup for nested method calls
Some
(
NodeInfo
{
callee_id
:
Some
(
id
),
_
})
if
id
==
scope_id
=>
{
Some
(
NodeInfo
{
callee_id
:
Some
(
id
),
_
})
if
id
==
scope_id
=>
{
return
bcx_sid
return
bcx_sid
}
}
...
...
src/librustc/middle/trans/expr.rs
浏览文件 @
0ef4e860
...
@@ -250,7 +250,8 @@ fn auto_slice(bcx: block, expr: @ast::expr, datum: Datum) -> DatumBlock {
...
@@ -250,7 +250,8 @@ fn auto_slice(bcx: block, expr: @ast::expr, datum: Datum) -> DatumBlock {
let
tcx
=
bcx
.tcx
();
let
tcx
=
bcx
.tcx
();
let
unit_ty
=
ty
::
sequence_element_type
(
tcx
,
datum
.ty
);
let
unit_ty
=
ty
::
sequence_element_type
(
tcx
,
datum
.ty
);
// NOTE prob need to distinguish "auto-slice" from explicit index?
// FIXME(#6272) need to distinguish "auto-slice" from explicit index?
let
(
bcx
,
base
,
len
)
=
let
(
bcx
,
base
,
len
)
=
datum
.get_vec_base_and_len
(
bcx
,
expr
.span
,
expr
.id
);
datum
.get_vec_base_and_len
(
bcx
,
expr
.span
,
expr
.id
);
...
...
src/librustc/middle/trans/reachable.rs
浏览文件 @
0ef4e860
...
@@ -75,11 +75,11 @@ fn traverse_def_id(cx: @mut ctx, did: def_id) {
...
@@ -75,11 +75,11 @@ fn traverse_def_id(cx: @mut ctx, did: def_id) {
Some
(
&
ast_map
::
node_item
(
item
,
_
))
=>
traverse_public_item
(
cx
,
item
),
Some
(
&
ast_map
::
node_item
(
item
,
_
))
=>
traverse_public_item
(
cx
,
item
),
Some
(
&
ast_map
::
node_method
(
_
,
impl_id
,
_
))
=>
traverse_def_id
(
cx
,
impl_id
),
Some
(
&
ast_map
::
node_method
(
_
,
impl_id
,
_
))
=>
traverse_def_id
(
cx
,
impl_id
),
Some
(
&
ast_map
::
node_foreign_item
(
item
,
_
,
_
,
_
))
=>
{
Some
(
&
ast_map
::
node_foreign_item
(
item
,
_
,
_
,
_
))
=>
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
cx
.rmap
.insert
(
item
.id
);
cx
.rmap
.insert
(
item
.id
);
}
}
Some
(
&
ast_map
::
node_variant
(
ref
v
,
_
,
_
))
=>
{
Some
(
&
ast_map
::
node_variant
(
ref
v
,
_
,
_
))
=>
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
cx
.rmap
.insert
(
v
.node.id
);
cx
.rmap
.insert
(
v
.node.id
);
}
}
_
=>
()
_
=>
()
...
@@ -109,7 +109,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
...
@@ -109,7 +109,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
item_foreign_mod
(
ref
nm
)
=>
{
item_foreign_mod
(
ref
nm
)
=>
{
if
!
traverse_exports
(
cx
,
item
.id
)
{
if
!
traverse_exports
(
cx
,
item
.id
)
{
for
nm
.items.each
|
item
|
{
for
nm
.items.each
|
item
|
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
cx
.rmap
.insert
(
item
.id
);
cx
.rmap
.insert
(
item
.id
);
}
}
}
}
...
@@ -127,7 +127,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
...
@@ -127,7 +127,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
attr
::
find_inline_attr
(
m
.attrs
)
!=
attr
::
ia_none
attr
::
find_inline_attr
(
m
.attrs
)
!=
attr
::
ia_none
{
{
{
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
cx
.rmap
.insert
(
m
.id
);
cx
.rmap
.insert
(
m
.id
);
}
}
traverse_inline_body
(
cx
,
&
m
.body
);
traverse_inline_body
(
cx
,
&
m
.body
);
...
@@ -136,7 +136,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
...
@@ -136,7 +136,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
}
}
item_struct
(
ref
struct_def
,
_
)
=>
{
item_struct
(
ref
struct_def
,
_
)
=>
{
for
struct_def
.ctor_id.each
|
&
ctor_id
|
{
for
struct_def
.ctor_id.each
|
&
ctor_id
|
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
cx
.rmap
.insert
(
ctor_id
);
cx
.rmap
.insert
(
ctor_id
);
}
}
}
}
...
@@ -153,7 +153,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
...
@@ -153,7 +153,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
fn
traverse_ty
<
'a
>
(
ty
:
@
Ty
,
cx
:
@
mut
ctx
<
'a
>
,
v
:
visit
::
vt
<@
mut
ctx
<
'a
>>
)
{
fn
traverse_ty
<
'a
>
(
ty
:
@
Ty
,
cx
:
@
mut
ctx
<
'a
>
,
v
:
visit
::
vt
<@
mut
ctx
<
'a
>>
)
{
{
{
let
cx
=
&
mut
*
cx
;
//
NOTE reborrow @
mut
let
cx
=
&
mut
*
cx
;
//
FIXME(#6269) reborrow @mut to &
mut
if
cx
.rmap
.contains
(
&
ty
.id
)
{
return
;
}
if
cx
.rmap
.contains
(
&
ty
.id
)
{
return
;
}
cx
.rmap
.insert
(
ty
.id
);
cx
.rmap
.insert
(
ty
.id
);
}
}
...
...
src/librustc/middle/typeck/check/mod.rs
浏览文件 @
0ef4e860
...
@@ -1301,12 +1301,11 @@ fn check_call(fcx: @mut FnCtxt,
...
@@ -1301,12 +1301,11 @@ fn check_call(fcx: @mut FnCtxt,
// Store the type of `f` as the type of the callee
// Store the type of `f` as the type of the callee
let
fn_ty
=
fcx
.expr_ty
(
f
);
let
fn_ty
=
fcx
.expr_ty
(
f
);
// NOTE here we write the callee type before regions have been
// FIXME(#6273) should write callee type AFTER regions have
// substituted; in the method case, we write the type after
// been subst'd. However, it is awkward to deal with this
// regions have been substituted. Methods are correct, but it
// now. Best thing would I think be to just have a separate
// is awkward to deal with this now. Best thing would I think
// "callee table" that contains the FnSig and not a general
// be to just have a separate "callee table" that contains the
// purpose ty::t
// FnSig and not a general purpose ty::t
fcx
.write_ty
(
call_expr
.callee_id
,
fn_ty
);
fcx
.write_ty
(
call_expr
.callee_id
,
fn_ty
);
// Extract the function signature from `in_fty`.
// Extract the function signature from `in_fty`.
...
...
src/librustc/middle/typeck/check/regionck.rs
浏览文件 @
0ef4e860
...
@@ -157,14 +157,17 @@ pub fn regionck_fn(fcx: @mut FnCtxt, blk: &ast::blk) {
...
@@ -157,14 +157,17 @@ pub fn regionck_fn(fcx: @mut FnCtxt, blk: &ast::blk) {
}
}
fn
regionck_visitor
()
->
rvt
{
fn
regionck_visitor
()
->
rvt
{
// FIXME(#3238) should use visit_pat, not visit_arm/visit_local,
// However, right now we run into an issue whereby some free
// regions are not properly related if they appear within the
// types of arguments that must be inferred. This could be
// addressed by deferring the construction of the region
// hierarchy, and in particular the relationships between free
// regions, until regionck, as described in #3238.
visit
::
mk_vt
(
@
visit
::
Visitor
{
visit_item
:
visit_item
,
visit
::
mk_vt
(
@
visit
::
Visitor
{
visit_item
:
visit_item
,
visit_expr
:
visit_expr
,
visit_expr
:
visit_expr
,
// NOTE this should be visit_pat
//visit_pat: visit_pat, // (*) see FIXME above
// but causes errors in formal
// arguments in closures due to
// #XYZ!
//visit_pat: visit_pat,
visit_arm
:
visit_arm
,
visit_arm
:
visit_arm
,
visit_local
:
visit_local
,
visit_local
:
visit_local
,
...
@@ -294,7 +297,7 @@ fn visit_expr(expr: @ast::expr, rcx: @mut Rcx, v: rvt) {
...
@@ -294,7 +297,7 @@ fn visit_expr(expr: @ast::expr, rcx: @mut Rcx, v: rvt) {
// Require that the resulting region encompasses
// Require that the resulting region encompasses
// the current node.
// the current node.
//
//
// FIXME(#
5074
) remove to support nested method calls
// FIXME(#
6268
) remove to support nested method calls
constrain_regions_in_type_of_node
(
constrain_regions_in_type_of_node
(
rcx
,
expr
.id
,
ty
::
re_scope
(
expr
.id
),
expr
.span
);
rcx
,
expr
.id
,
ty
::
re_scope
(
expr
.id
),
expr
.span
);
}
}
...
@@ -374,7 +377,7 @@ fn visit_expr(expr: @ast::expr, rcx: @mut Rcx, v: rvt) {
...
@@ -374,7 +377,7 @@ fn visit_expr(expr: @ast::expr, rcx: @mut Rcx, v: rvt) {
// the type of the node expr.id here *before applying
// the type of the node expr.id here *before applying
// adjustments*.
// adjustments*.
//
//
// FIXME(#
5074
) nested method calls requires that this rule change
// FIXME(#
6268
) nested method calls requires that this rule change
let
ty0
=
rcx
.resolve_node_type
(
expr
.id
);
let
ty0
=
rcx
.resolve_node_type
(
expr
.id
);
constrain_regions_in_type
(
rcx
,
ty
::
re_scope
(
expr
.id
),
expr
.span
,
ty0
);
constrain_regions_in_type
(
rcx
,
ty
::
re_scope
(
expr
.id
),
expr
.span
,
ty0
);
}
}
...
@@ -462,7 +465,7 @@ fn constrain_call(rcx: @mut Rcx,
...
@@ -462,7 +465,7 @@ fn constrain_call(rcx: @mut Rcx,
// `callee_region` is the scope representing the time in which the
// `callee_region` is the scope representing the time in which the
// call occurs.
// call occurs.
//
//
// FIXME(#
5074
) to support nested method calls, should be callee_id
// FIXME(#
6268
) to support nested method calls, should be callee_id
let
callee_scope
=
call_expr
.id
;
let
callee_scope
=
call_expr
.id
;
let
callee_region
=
ty
::
re_scope
(
callee_scope
);
let
callee_region
=
ty
::
re_scope
(
callee_scope
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录