Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
72d5f39b
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,发现更多精彩内容 >>
提交
72d5f39b
编写于
2月 24, 2015
作者:
E
Eduard Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix fallout from rebasing.
上级
8501c9de
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
21 deletion
+22
-21
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+2
-2
src/librustc/middle/ty.rs
src/librustc/middle/ty.rs
+6
-9
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/build_reduced_graph.rs
+1
-1
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+4
-4
src/librustc_trans/save/mod.rs
src/librustc_trans/save/mod.rs
+1
-1
src/librustc_typeck/coherence/orphan.rs
src/librustc_typeck/coherence/orphan.rs
+2
-2
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+6
-2
未找到文件。
src/librustc/metadata/encoder.rs
浏览文件 @
72d5f39b
...
...
@@ -1193,7 +1193,7 @@ fn add_to_index(item: &ast::Item, rbml_w: &Encoder,
None
=>
{}
}
}
ast
::
ItemDefaultImpl
(
unsafety
,
ref
ast_trait_ref
)
=>
{
ast
::
ItemDefaultImpl
(
unsafety
,
_
)
=>
{
add_to_index
(
item
,
rbml_w
,
index
);
rbml_w
.start_tag
(
tag_items_data_item
);
encode_def_id
(
rbml_w
,
def_id
);
...
...
@@ -1201,7 +1201,7 @@ fn add_to_index(item: &ast::Item, rbml_w: &Encoder,
encode_name
(
rbml_w
,
item
.ident.name
);
encode_unsafety
(
rbml_w
,
unsafety
);
let
trait_ref
=
ty
::
node_id_to_trait_ref
(
tcx
,
ast_trait_ref
.ref_
id
);
let
trait_ref
=
ty
::
impl_id_to_trait_ref
(
tcx
,
item
.
id
);
encode_trait_ref
(
rbml_w
,
ecx
,
&*
trait_ref
,
tag_item_trait_ref
);
rbml_w
.end_tag
();
}
...
...
src/librustc/middle/ty.rs
浏览文件 @
72d5f39b
...
...
@@ -5116,15 +5116,12 @@ pub fn impl_trait_ref<'tcx>(cx: &ctxt<'tcx>, id: ast::DefId)
if
id
.krate
==
ast
::
LOCAL_CRATE
{
debug!
(
"(impl_trait_ref) searching for trait impl {:?}"
,
id
);
if
let
Some
(
ast_map
::
NodeItem
(
item
))
=
cx
.map
.find
(
id
.node
)
{
if
let
ast
::
ItemImpl
(
_
,
_
,
_
,
ref
opt_trait
,
_
,
_
)
=
item
.node
{
opt_trait
.as_ref
()
.map
(|
_
|
{
ty
::
impl_id_to_trait_ref
(
cx
,
id
.node
)
})
}
else
{
None
ast
::
ItemDefaultImpl
(
_
,
ref
ast_trait_ref
)
=>
{
Some
(
ty
::
node_id_to_trait_ref
(
cx
,
ast_trait_ref
.ref_id
))
}
match
item
.node
{
ast
::
ItemImpl
(
_
,
_
,
_
,
Some
(
_
),
_
,
_
)
|
ast
::
ItemDefaultImpl
(
..
)
=>
{
Some
(
ty
::
impl_id_to_trait_ref
(
cx
,
id
.node
))
}
_
=>
None
}
}
else
{
None
...
...
src/librustc_resolve/build_reduced_graph.rs
浏览文件 @
72d5f39b
...
...
@@ -504,8 +504,8 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
parent
.clone
()
}
ItemImpl
(
..
)
=>
parent
.clone
(),
ItemDefaultImpl
(
_
,
_
)
|
ItemImpl
(
..
)
=>
parent
.clone
(),
ItemTrait
(
_
,
_
,
_
,
ref
items
)
=>
{
let
name_bindings
=
...
...
src/librustc_resolve/lib.rs
浏览文件 @
72d5f39b
...
...
@@ -2772,7 +2772,7 @@ fn resolve_item(&mut self, item: &Item) {
}
ItemDefaultImpl
(
_
,
ref
trait_ref
)
=>
{
self
.
resolve_trait_reference
(
item
.id
,
trait_ref
,
TraitImplementation
);
self
.
with_optional_trait_ref
(
Some
(
trait_ref
),
|
_
|
{}
);
}
ItemImpl
(
_
,
_
,
ref
generics
,
...
...
@@ -3022,12 +3022,12 @@ fn with_current_self_type<T, F>(&mut self, self_type: &Ty, f: F) -> T where
}
fn
with_optional_trait_ref
<
T
,
F
>
(
&
mut
self
,
opt_trait_ref
:
&
Option
<
TraitRef
>
,
opt_trait_ref
:
Option
<&
TraitRef
>
,
f
:
F
)
->
T
where
F
:
FnOnce
(
&
mut
Resolver
)
->
T
,
{
let
mut
new_val
=
None
;
if
let
Some
(
ref
trait_ref
)
=
*
opt_trait_ref
{
if
let
Some
(
trait_ref
)
=
opt_trait_ref
{
match
self
.resolve_trait_reference
(
trait_ref
.ref_id
,
&
trait_ref
.path
,
0
)
{
Ok
(
path_res
)
=>
{
self
.record_def
(
trait_ref
.ref_id
,
path_res
);
...
...
@@ -3057,7 +3057,7 @@ fn resolve_implementation(&mut self,
this
.visit_generics
(
generics
);
// Resolve the trait reference, if necessary.
this
.with_optional_trait_ref
(
opt_trait_reference
,
|
this
|
{
this
.with_optional_trait_ref
(
opt_trait_reference
.as_ref
()
,
|
this
|
{
// Resolve the self type.
this
.visit_ty
(
self_type
);
...
...
src/librustc_trans/save/mod.rs
浏览文件 @
72d5f39b
...
...
@@ -1004,7 +1004,7 @@ fn process_pat(&mut self, p:&ast::Pat) {
self
.collected_paths
.push
((
p
.id
,
path
.clone
(),
false
,
recorder
::
StructRef
));
visit
::
walk_path
(
self
,
path
);
let
def
=
self
.analysis.ty_cx.def_map
.borrow
()[
p
.id
];
let
def
=
self
.analysis.ty_cx.def_map
.borrow
()[
p
.id
]
.full_def
()
;
let
struct_def
=
match
def
{
def
::
DefConst
(
..
)
=>
None
,
def
::
DefVariant
(
_
,
variant_id
,
_
)
=>
Some
(
variant_id
),
...
...
src/librustc_typeck/coherence/orphan.rs
浏览文件 @
72d5f39b
...
...
@@ -93,10 +93,10 @@ fn visit_item(&mut self, item: &ast::Item) {
}
}
}
ast
::
ItemDefaultImpl
(
_
,
ref
ast_trait_ref
)
=>
{
ast
::
ItemDefaultImpl
(
..
)
=>
{
// "Trait" impl
debug!
(
"coherence2::orphan check: default trait impl {}"
,
item
.repr
(
self
.tcx
));
let
trait_ref
=
ty
::
node_id_to_trait_ref
(
self
.tcx
,
ast_trait_ref
.ref_id
);
let
trait_ref
=
ty
::
impl_trait_ref
(
self
.tcx
,
def_id
)
.unwrap
(
);
if
trait_ref
.def_id.krate
!=
ast
::
LOCAL_CRATE
{
span_err!
(
self
.tcx.sess
,
item
.span
,
E0318
,
"cannot create default implementations for traits outside the
\
...
...
src/librustc_typeck/collect.rs
浏览文件 @
72d5f39b
...
...
@@ -649,8 +649,12 @@ fn convert_item(ccx: &CollectCtxt, it: &ast::Item) {
&
enum_definition
.variants
);
},
ast
::
ItemDefaultImpl
(
_
,
ref
ast_trait_ref
)
=>
{
let
trait_ref
=
astconv
::
instantiate_trait_ref
(
ccx
,
&
ExplicitRscope
,
ast_trait_ref
,
None
,
None
);
let
trait_ref
=
astconv
::
instantiate_trait_ref
(
ccx
,
&
ExplicitRscope
,
ast_trait_ref
,
Some
(
it
.id
),
None
,
None
);
ty
::
record_default_trait_implementation
(
tcx
,
trait_ref
.def_id
,
local_def
(
it
.id
))
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录