Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4148d536
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,发现更多精彩内容 >>
提交
4148d536
编写于
1月 22, 2015
作者:
F
Flavio Percoco
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix fallout from libsyntax implementation
上级
6a2f16e1
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
35 addition
and
8 deletion
+35
-8
src/librustc/metadata/decoder.rs
src/librustc/metadata/decoder.rs
+5
-3
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+12
-0
src/librustc/middle/reachable.rs
src/librustc/middle/reachable.rs
+2
-1
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/resolve_lifetime.rs
+1
-0
src/librustc_privacy/lib.rs
src/librustc_privacy/lib.rs
+3
-2
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/build_reduced_graph.rs
+2
-1
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+4
-1
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+4
-0
src/librustc_typeck/variance.rs
src/librustc_typeck/variance.rs
+2
-0
未找到文件。
src/librustc/metadata/decoder.rs
浏览文件 @
4148d536
...
...
@@ -126,6 +126,7 @@ enum Family {
TupleVariant
,
// v
StructVariant
,
// V
Impl
,
// i
DefTrait
,
// d
Trait
,
// I
Struct
,
// S
PublicField
,
// g
...
...
@@ -151,6 +152,7 @@ fn item_family(item: rbml::Doc) -> Family {
'v'
=>
TupleVariant
,
'V'
=>
StructVariant
,
'i'
=>
Impl
,
'd'
=>
DefTrait
,
'I'
=>
Trait
,
'S'
=>
Struct
,
'g'
=>
PublicField
,
...
...
@@ -357,7 +359,7 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
}
Trait
=>
DlDef
(
def
::
DefTrait
(
did
)),
Enum
=>
DlDef
(
def
::
DefTy
(
did
,
true
)),
Impl
=>
DlImpl
(
did
),
Impl
|
DefTrait
=>
DlImpl
(
did
),
PublicField
|
InheritedField
=>
DlField
,
}
}
...
...
@@ -480,7 +482,7 @@ pub fn get_impl_trait<'tcx>(cdata: Cmd,
let
item_doc
=
lookup_item
(
id
,
cdata
.data
());
let
fam
=
item_family
(
item_doc
);
match
fam
{
Family
::
Impl
=>
{
Family
::
Impl
|
Family
::
DefTrait
=>
{
reader
::
maybe_get_doc
(
item_doc
,
tag_item_trait_ref
)
.map
(|
tp
|
{
doc_trait_ref
(
tp
,
tcx
,
cdata
)
})
...
...
@@ -1356,7 +1358,7 @@ pub fn get_trait_of_item(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
let
parent_item_doc
=
lookup_item
(
parent_item_id
.node
,
cdata
.data
());
match
item_family
(
parent_item_doc
)
{
Trait
=>
Some
(
item_def_id
(
parent_item_doc
,
cdata
)),
Impl
=>
{
Impl
|
DefTrait
=>
{
reader
::
maybe_get_doc
(
parent_item_doc
,
tag_item_trait_ref
)
.map
(|
_
|
item_trait_ref
(
parent_item_doc
,
tcx
,
cdata
)
.def_id
)
}
...
...
src/librustc/metadata/encoder.rs
浏览文件 @
4148d536
...
...
@@ -1201,6 +1201,18 @@ fn add_to_index(item: &ast::Item, rbml_w: &Encoder,
None
=>
{}
}
}
ast
::
ItemDefTrait
(
unsafety
,
ref
ast_trait_ref
)
=>
{
add_to_index
(
item
,
rbml_w
,
index
);
rbml_w
.start_tag
(
tag_items_data_item
);
encode_def_id
(
rbml_w
,
def_id
);
encode_family
(
rbml_w
,
'd'
);
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
);
encode_trait_ref
(
rbml_w
,
ecx
,
&*
trait_ref
,
tag_item_trait_ref
);
rbml_w
.end_tag
();
}
ast
::
ItemImpl
(
unsafety
,
polarity
,
_
,
ref
opt_trait
,
ref
ty
,
ref
ast_items
)
=>
{
// We need to encode information about the default methods we
// have inherited, so we drive this based on the impl structure.
...
...
src/librustc/middle/reachable.rs
浏览文件 @
4148d536
...
...
@@ -301,7 +301,8 @@ fn propagate_node(&mut self, node: &ast_map::Node,
ast
::
ItemTy
(
..
)
|
ast
::
ItemStatic
(
_
,
_
,
_
)
|
ast
::
ItemMod
(
..
)
|
ast
::
ItemForeignMod
(
..
)
|
ast
::
ItemImpl
(
..
)
|
ast
::
ItemTrait
(
..
)
|
ast
::
ItemStruct
(
..
)
|
ast
::
ItemEnum
(
..
)
=>
{}
ast
::
ItemStruct
(
..
)
|
ast
::
ItemEnum
(
..
)
|
ast
::
ItemDefTrait
(
..
)
=>
{}
_
=>
{
self
.tcx.sess
.span_bug
(
item
.span
,
...
...
src/librustc/middle/resolve_lifetime.rs
浏览文件 @
4148d536
...
...
@@ -115,6 +115,7 @@ fn visit_item(&mut self, item: &ast::Item) {
ast
::
ItemUse
(
_
)
|
ast
::
ItemMod
(
..
)
|
ast
::
ItemMac
(
..
)
|
ast
::
ItemDefTrait
(
..
)
|
ast
::
ItemForeignMod
(
..
)
|
ast
::
ItemStatic
(
..
)
|
ast
::
ItemConst
(
..
)
=>
{
...
...
src/librustc_privacy/lib.rs
浏览文件 @
4148d536
...
...
@@ -209,7 +209,7 @@ fn visit_item(&mut self, item: &ast::Item) {
match
item
.node
{
// impls/extern blocks do not break the "public chain" because they
// cannot have visibility qualifiers on them anyway
ast
::
ItemImpl
(
..
)
|
ast
::
ItemForeignMod
(
..
)
=>
{}
ast
::
ItemImpl
(
..
)
|
ast
::
Item
DefTrait
(
..
)
|
ast
::
Item
ForeignMod
(
..
)
=>
{}
// Traits are a little special in that even if they themselves are
// not public they may still be exported.
...
...
@@ -1145,6 +1145,7 @@ fn check_sane_privacy(&self, item: &ast::Item) {
}
}
ast
::
ItemDefTrait
(
..
)
|
ast
::
ItemConst
(
..
)
|
ast
::
ItemStatic
(
..
)
|
ast
::
ItemStruct
(
..
)
|
ast
::
ItemFn
(
..
)
|
ast
::
ItemMod
(
..
)
|
ast
::
ItemTy
(
..
)
|
ast
::
ItemExternCrate
(
_
)
|
ast
::
ItemUse
(
_
)
|
ast
::
ItemMac
(
..
)
=>
{}
...
...
@@ -1204,7 +1205,7 @@ fn check_inherited(tcx: &ty::ctxt, sp: Span, vis: ast::Visibility) {
}
}
ast
::
ItemExternCrate
(
_
)
|
ast
::
ItemUse
(
_
)
|
ast
::
Item
DefTrait
(
..
)
|
ast
::
Item
ExternCrate
(
_
)
|
ast
::
ItemUse
(
_
)
|
ast
::
ItemStatic
(
..
)
|
ast
::
ItemConst
(
..
)
|
ast
::
ItemFn
(
..
)
|
ast
::
ItemMod
(
..
)
|
ast
::
ItemTy
(
..
)
|
ast
::
ItemMac
(
..
)
=>
{}
...
...
src/librustc_resolve/build_reduced_graph.rs
浏览文件 @
4148d536
...
...
@@ -40,7 +40,7 @@
use
syntax
::
ast
::{
DeclItem
,
DefId
};
use
syntax
::
ast
::{
ForeignItem
,
ForeignItemFn
,
ForeignItemStatic
};
use
syntax
::
ast
::{
Item
,
ItemConst
,
ItemEnum
,
ItemExternCrate
,
ItemFn
};
use
syntax
::
ast
::{
ItemForeignMod
,
ItemImpl
,
ItemMac
,
ItemMod
,
ItemStatic
};
use
syntax
::
ast
::{
ItemForeignMod
,
ItemImpl
,
ItemMac
,
ItemMod
,
ItemStatic
,
ItemDefTrait
};
use
syntax
::
ast
::{
ItemStruct
,
ItemTrait
,
ItemTy
,
ItemUse
};
use
syntax
::
ast
::{
MethodImplItem
,
Name
,
NamedField
,
NodeId
};
use
syntax
::
ast
::{
PathListIdent
,
PathListMod
};
...
...
@@ -656,6 +656,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
parent
.clone
()
}
ItemDefTrait
(
_
,
_
)
|
ItemImpl
(
_
,
_
,
_
,
Some
(
_
),
_
,
_
)
=>
parent
.clone
(),
ItemTrait
(
_
,
_
,
_
,
ref
items
)
=>
{
...
...
src/librustc_resolve/lib.rs
浏览文件 @
4148d536
...
...
@@ -70,7 +70,7 @@
use
syntax
::
ast
::{
ExprPath
,
ExprQPath
,
ExprStruct
,
FnDecl
};
use
syntax
::
ast
::{
ForeignItemFn
,
ForeignItemStatic
,
Generics
};
use
syntax
::
ast
::{
Ident
,
ImplItem
,
Item
,
ItemConst
,
ItemEnum
,
ItemExternCrate
};
use
syntax
::
ast
::{
ItemFn
,
ItemForeignMod
,
ItemImpl
,
ItemMac
,
ItemMod
,
ItemStatic
};
use
syntax
::
ast
::{
ItemFn
,
ItemForeignMod
,
ItemImpl
,
ItemMac
,
ItemMod
,
ItemStatic
,
ItemDefTrait
};
use
syntax
::
ast
::{
ItemStruct
,
ItemTrait
,
ItemTy
,
ItemUse
};
use
syntax
::
ast
::{
Local
,
MethodImplItem
,
Mod
,
Name
,
NodeId
};
use
syntax
::
ast
::{
Pat
,
PatEnum
,
PatIdent
,
PatLit
};
...
...
@@ -2840,6 +2840,9 @@ fn resolve_item(&mut self, item: &Item) {
});
}
ItemDefTrait
(
_
,
ref
trait_ref
)
=>
{
self
.resolve_trait_reference
(
item
.id
,
trait_ref
,
TraitImplementation
);
}
ItemImpl
(
_
,
_
,
ref
generics
,
ref
implemented_traits
,
...
...
src/librustc_typeck/collect.rs
浏览文件 @
4148d536
...
...
@@ -648,6 +648,9 @@ fn convert_item(ccx: &CollectCtxt, it: &ast::Item) {
predicates
,
&
enum_definition
.variants
);
},
ast
::
ItemDefTrait
(
_
,
ref
ast_trait_ref
)
=>
{
}
ast
::
ItemImpl
(
_
,
_
,
ref
generics
,
ref
opt_trait_ref
,
...
...
@@ -1141,6 +1144,7 @@ fn compute_type_scheme_of_item<'a,'tcx>(ccx: &CollectCtxt<'a,'tcx>,
let
t
=
ty
::
mk_struct
(
tcx
,
local_def
(
it
.id
),
tcx
.mk_substs
(
substs
));
ty
::
TypeScheme
{
ty
:
t
,
generics
:
ty_generics
}
}
ast
::
ItemDefTrait
(
..
)
|
ast
::
ItemTrait
(
..
)
|
ast
::
ItemImpl
(
..
)
|
ast
::
ItemMod
(
..
)
|
...
...
src/librustc_typeck/variance.rs
浏览文件 @
4148d536
...
...
@@ -476,6 +476,7 @@ fn visit_item(&mut self, item: &ast::Item) {
ast
::
ItemExternCrate
(
_
)
|
ast
::
ItemUse
(
_
)
|
ast
::
ItemDefTrait
(
..
)
|
ast
::
ItemImpl
(
..
)
|
ast
::
ItemStatic
(
..
)
|
ast
::
ItemConst
(
..
)
|
...
...
@@ -626,6 +627,7 @@ fn visit_item(&mut self, item: &ast::Item) {
ast
::
ItemForeignMod
(
..
)
|
ast
::
ItemTy
(
..
)
|
ast
::
ItemImpl
(
..
)
|
ast
::
ItemDefTrait
(
..
)
|
ast
::
ItemMac
(
..
)
=>
{
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录