Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
34c76646
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,发现更多精彩内容 >>
提交
34c76646
编写于
11月 23, 2014
作者:
N
Nick Cameron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save-analysis: add values for types
上级
e83785c5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
13 deletion
+22
-13
src/librustc_trans/save/mod.rs
src/librustc_trans/save/mod.rs
+9
-4
src/librustc_trans/save/recorder.rs
src/librustc_trans/save/recorder.rs
+13
-9
未找到文件。
src/librustc_trans/save/mod.rs
浏览文件 @
34c76646
...
...
@@ -568,13 +568,15 @@ fn process_struct(&mut self,
Some
(
node_id
)
=>
node_id
,
None
=>
-
1
,
};
let
val
=
self
.span
.snippet
(
item
.span
);
let
sub_span
=
self
.span
.sub_span_after_keyword
(
item
.span
,
keywords
::
Struct
);
self
.fmt
.struct_str
(
item
.span
,
sub_span
,
item
.id
,
ctor_id
,
qualname
.as_slice
(),
self
.cur_scope
);
self
.cur_scope
,
val
.as_slice
());
// fields
for
field
in
def
.fields
.iter
()
{
...
...
@@ -590,12 +592,14 @@ fn process_enum(&mut self,
enum_definition
:
&
ast
::
EnumDef
,
ty_params
:
&
ast
::
Generics
)
{
let
enum_name
=
self
.analysis.ty_cx.map
.path_to_string
(
item
.id
);
let
val
=
self
.span
.snippet
(
item
.span
);
match
self
.span
.sub_span_after_keyword
(
item
.span
,
keywords
::
Enum
)
{
Some
(
sub_span
)
=>
self
.fmt
.enum_str
(
item
.span
,
Some
(
sub_span
),
item
.id
,
enum_name
.as_slice
(),
self
.cur_scope
),
self
.cur_scope
,
val
.as_slice
()),
None
=>
self
.sess
.span_bug
(
item
.span
,
format!
(
"Could not find subspan for enum {}"
,
enum_name
)
.as_slice
()),
...
...
@@ -700,13 +704,14 @@ fn process_trait(&mut self,
trait_refs
:
&
OwnedSlice
<
ast
::
TyParamBound
>
,
methods
:
&
Vec
<
ast
::
TraitItem
>
)
{
let
qualname
=
self
.analysis.ty_cx.map
.path_to_string
(
item
.id
);
let
val
=
self
.span
.snippet
(
item
.span
);
let
sub_span
=
self
.span
.sub_span_after_keyword
(
item
.span
,
keywords
::
Trait
);
self
.fmt
.trait_str
(
item
.span
,
sub_span
,
item
.id
,
qualname
.as_slice
(),
self
.cur_scope
);
self
.cur_scope
,
val
.as_slice
());
// super-traits
for
super_bound
in
trait_refs
.iter
()
{
...
...
src/librustc_trans/save/recorder.rs
浏览文件 @
34c76646
...
...
@@ -106,7 +106,7 @@ fn lookup_row(r: Row) -> (&'static str, Vec<&'static str>, bool, bool) {
Variable
=>
(
"variable"
,
vec!
(
"id"
,
"name"
,
"qualname"
,
"value"
,
"type"
,
"scopeid"
),
true
,
true
),
Enum
=>
(
"enum"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
),
true
,
true
),
Enum
=>
(
"enum"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
,
"value"
),
true
,
true
),
Variant
=>
(
"variant"
,
vec!
(
"id"
,
"name"
,
"qualname"
,
"type"
,
"value"
,
"scopeid"
),
true
,
true
),
...
...
@@ -117,8 +117,8 @@ fn lookup_row(r: Row) -> (&'static str, Vec<&'static str>, bool, bool) {
vec!
(
"id"
,
"qualname"
,
"declid"
,
"declidcrate"
,
"scopeid"
),
true
,
true
),
MethodDecl
=>
(
"method_decl"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
),
true
,
true
),
Struct
=>
(
"struct"
,
vec!
(
"id"
,
"ctor_id"
,
"qualname"
,
"scopeid"
),
true
,
true
),
Trait
=>
(
"trait"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
),
true
,
true
),
Struct
=>
(
"struct"
,
vec!
(
"id"
,
"ctor_id"
,
"qualname"
,
"scopeid"
,
"value"
),
true
,
true
),
Trait
=>
(
"trait"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
,
"value"
),
true
,
true
),
Impl
=>
(
"impl"
,
vec!
(
"id"
,
"refid"
,
"refidcrate"
,
"scopeid"
),
true
,
true
),
Module
=>
(
"module"
,
vec!
(
"id"
,
"qualname"
,
"scopeid"
,
"def_file"
),
true
,
false
),
UseAlias
=>
(
"use_alias"
,
...
...
@@ -161,6 +161,7 @@ pub fn make_values_str(&self,
}
let
values
=
values
.iter
()
.map
(|
s
|
{
// Never take more than 1020 chars
if
s
.len
()
>
1020
{
s
.as_slice
()
.slice_to
(
1020
)
}
else
{
...
...
@@ -327,11 +328,12 @@ pub fn enum_str(&mut self,
sub_span
:
Option
<
Span
>
,
id
:
NodeId
,
name
:
&
str
,
scope_id
:
NodeId
)
{
scope_id
:
NodeId
,
value
:
&
str
)
{
self
.check_and_record
(
Enum
,
span
,
sub_span
,
svec!
(
id
,
name
,
scope_id
));
svec!
(
id
,
name
,
scope_id
,
value
));
}
pub
fn
tuple_variant_str
(
&
mut
self
,
...
...
@@ -411,11 +413,12 @@ pub fn struct_str(&mut self,
id
:
NodeId
,
ctor_id
:
NodeId
,
name
:
&
str
,
scope_id
:
NodeId
)
{
scope_id
:
NodeId
,
value
:
&
str
)
{
self
.check_and_record
(
Struct
,
span
,
sub_span
,
svec!
(
id
,
ctor_id
,
name
,
scope_id
));
svec!
(
id
,
ctor_id
,
name
,
scope_id
,
value
));
}
pub
fn
trait_str
(
&
mut
self
,
...
...
@@ -423,11 +426,12 @@ pub fn trait_str(&mut self,
sub_span
:
Option
<
Span
>
,
id
:
NodeId
,
name
:
&
str
,
scope_id
:
NodeId
)
{
scope_id
:
NodeId
,
value
:
&
str
)
{
self
.check_and_record
(
Trait
,
span
,
sub_span
,
svec!
(
id
,
name
,
scope_id
));
svec!
(
id
,
name
,
scope_id
,
value
));
}
pub
fn
impl_str
(
&
mut
self
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录