Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
10a862d4
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,发现更多精彩内容 >>
提交
10a862d4
编写于
12月 18, 2014
作者:
E
Eduard Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc: middle: use cheaper Name in resolve::Export instead of String.
上级
f0276072
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
9 deletion
+6
-9
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+4
-6
src/librustc/middle/resolve.rs
src/librustc/middle/resolve.rs
+2
-3
未找到文件。
src/librustc/metadata/encoder.rs
浏览文件 @
10a862d4
...
...
@@ -451,8 +451,6 @@ fn encode_reexported_static_methods(ecx: &EncodeContext,
mod_path
:
PathElems
,
exp
:
&
middle
::
resolve
::
Export
)
{
if
let
Some
(
ast_map
::
NodeItem
(
item
))
=
ecx
.tcx.map
.find
(
exp
.def_id.node
)
{
let
original_name
=
token
::
get_ident
(
item
.ident
);
let
path_differs
=
ecx
.tcx.map
.with_path
(
exp
.def_id.node
,
|
path
|
{
let
(
mut
a
,
mut
b
)
=
(
path
,
mod_path
.clone
());
loop
{
...
...
@@ -474,16 +472,16 @@ fn encode_reexported_static_methods(ecx: &EncodeContext,
// encoded metadata for static methods relative to Bar,
// but not yet for Foo.
//
if
path_differs
||
original_name
.get
()
!=
exp
.name
{
if
path_differs
||
item
.ident.name
!=
exp
.name
{
if
!
encode_reexported_static_base_methods
(
ecx
,
rbml_w
,
exp
)
{
if
encode_reexported_static_trait_methods
(
ecx
,
rbml_w
,
exp
)
{
debug!
(
"(encode reexported static methods) {} [trait]"
,
original_
name
);
item
.ident.
name
);
}
}
else
{
debug!
(
"(encode reexported static methods) {} [base]"
,
original_
name
);
item
.ident.
name
);
}
}
}
...
...
@@ -534,7 +532,7 @@ fn encode_reexports(ecx: &EncodeContext,
rbml_w
.wr_str
(
def_to_string
(
exp
.def_id
)
.as_slice
());
rbml_w
.end_tag
();
rbml_w
.start_tag
(
tag_items_data_item_reexport_name
);
rbml_w
.wr_str
(
exp
.name
.as_s
lice
());
rbml_w
.wr_str
(
exp
.name
.as_s
tr
());
rbml_w
.end_tag
();
rbml_w
.end_tag
();
encode_reexported_static_methods
(
ecx
,
rbml_w
,
path
.clone
(),
exp
);
...
...
src/librustc/middle/resolve.rs
浏览文件 @
10a862d4
...
...
@@ -98,7 +98,7 @@ struct BindingInfo {
pub
type
ExportMap
=
NodeMap
<
Vec
<
Export
>>
;
pub
struct
Export
{
pub
name
:
String
,
// The name of the target.
pub
name
:
Name
,
// The name of the target.
pub
def_id
:
DefId
,
// The definition of the target.
}
...
...
@@ -3873,11 +3873,10 @@ fn add_exports_of_namebindings(&mut self,
ns
:
Namespace
)
{
match
namebindings
.def_for_namespace
(
ns
)
{
Some
(
d
)
=>
{
let
name
=
token
::
get_name
(
name
);
debug!
(
"(computing exports) YES: export '{}' => {}"
,
name
,
d
.def_id
());
exports
.push
(
Export
{
name
:
name
.get
()
.to_string
()
,
name
:
name
,
def_id
:
d
.def_id
()
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录